This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author marco.buttu
Recipients docs@python, ezio.melotti, marco.buttu, r.david.murray
Date 2012-10-29.15:19:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351523957.42.0.744095565727.issue16355@psf.upfronthosting.co.za>
In-reply-to
Content
I saw there is the same lack of clarity in the doc of `inspect.getsource()`:

>>> import inspect
>>> print(inspect.getsource.__doc__)
Return the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    IOError is raised if the source code cannot be retrieved.
>>> def foo():
...     pass
... 
>>> inspect.getsource(foo)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.3/inspect.py", line 726, in getsource
    lines, lnum = getsourcelines(object)
  File "/usr/local/lib/python3.3/inspect.py", line 715, in getsourcelines
    lines, lnum = findsource(object)
  File "/usr/local/lib/python3.3/inspect.py", line 563, in findsource
    raise IOError('could not get source code')
OSError: could not get source code
History
Date User Action Args
2012-10-29 15:19:17marco.buttusetrecipients: + marco.buttu, ezio.melotti, r.david.murray, docs@python
2012-10-29 15:19:17marco.buttusetmessageid: <1351523957.42.0.744095565727.issue16355@psf.upfronthosting.co.za>
2012-10-29 15:19:17marco.buttulinkissue16355 messages
2012-10-29 15:19:17marco.buttucreate