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 Eric.Wieser
Recipients Claudiu.Popa, Eric.Wieser, belopolsky, christian.heimes, gpolo, michele_s, pitrou, python-dev, yselivanov, ysj.ray
Date 2018-07-31.06:13:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533017624.47.0.56676864532.issue1764286@psf.upfronthosting.co.za>
In-reply-to
Content
This now leaves `inspect.getsource` inconsistent with `inspect.getsourcefile`:

>>> import inspect
>>> from contextlib import contextmanager

>>> @contextmanager
... def func():
...    yield

>>> inspect.getsource(func)
'@contextmanager\ndef func():\n    yield\n'
>>>inspect.getsourcefile(func)
'C:\\Program Files\\Python 3.5\\lib\\contextlib.py'

Should `getsourcefile` be changed to match?

This is causing numpy/numpy#11639, but it's not clear if this is a bug or by design.
History
Date User Action Args
2018-07-31 06:13:44Eric.Wiesersetrecipients: + Eric.Wieser, michele_s, belopolsky, pitrou, christian.heimes, gpolo, ysj.ray, Claudiu.Popa, python-dev, yselivanov
2018-07-31 06:13:44Eric.Wiesersetmessageid: <1533017624.47.0.56676864532.issue1764286@psf.upfronthosting.co.za>
2018-07-31 06:13:44Eric.Wieserlinkissue1764286 messages
2018-07-31 06:13:44Eric.Wiesercreate