We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4c8d7c commit 177a040Copy full SHA for 177a040
Doc/library/inspect.rst
@@ -699,10 +699,9 @@ Retrieving source code
699
function.
700
701
.. note::
702
- This function returns the *lines* of source code where the object is
703
- defined. If multiple objects are defined on the same line (e.g.
704
- multiple lambdas), or if the object is embedded in a larger statement
705
- (e.g. a list comprehension), the function will return the entire line(s).
+ This function returns the lines of source code where the object is
+ defined, including indentation. It always returns full lines and does not
+ strip other code that may appear on the same line.
706
707
.. versionchanged:: 3.3
708
:exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the
0 commit comments