[New-bugs-announce] [issue32313] Wrong inspect.getsource for datetime

Aaron Meurer report at bugs.python.org
Wed Dec 13 16:46:39 EST 2017


New submission from Aaron Meurer <asmeurer at gmail.com>:

inspect.getsource(datetime) shows the Python source code for datetime, even when it is the C extension. This is very confusing. 

I believe it's because _datetime is used to override everything in datetime at the end of the file (here https://github.com/python/cpython/blob/11a247df88f15b51feff8a3c46005676bb29b96e/Lib/datetime.py#L2285), but __file__ is not imported.

----------
messages: 308255
nosy: Aaron.Meurer
priority: normal
severity: normal
status: open
title: Wrong inspect.getsource for datetime

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32313>
_______________________________________


More information about the New-bugs-announce mailing list