diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-03-17 11:37:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-17 11:37:51 (GMT) |
commit | 41b4a2189f29daae008e57f799a30890643d191f (patch) | |
tree | e6acafe61c897e4dbc133efd2e607e19baae1488 /Doc/library | |
parent | 091d90f9a429b81b046cb83582062941f8ded9da (diff) | |
download | cpython-41b4a2189f29daae008e57f799a30890643d191f.zip cpython-41b4a2189f29daae008e57f799a30890643d191f.tar.gz cpython-41b4a2189f29daae008e57f799a30890643d191f.tar.bz2 |
bpo-16355: Clarify when inspect.getcomments() returns None (#428) (#691)
Initial patch by Vajrasky Kok.
(cherry picked from commit 3f2155ffe683080f2a1b28408fa48d43ba92f943)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/inspect.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 89263e7..9526a0d 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -440,7 +440,9 @@ Retrieving source code Return in a single string any lines of comments immediately preceding the object's source code (for a class, function, or method), or at the top of the - Python source file (if the object is a module). + Python source file (if the object is a module). If the object's source code + is unavailable, return ``None``. This could happen if the object has been + defined in C or the interactive shell. .. function:: getfile(object) |