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 p-ganssle
Recipients Aaron.Meurer, belopolsky, corona10, iritkatriel, p-ganssle, thatiparthy, xtreak, yselivanov
Date 2020-08-27.21:16:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598563011.92.0.793615950655.issue32313@roundup.psfhosted.org>
In-reply-to
Content
I think that we should re-examine this issue after GH-20472 is merged. I'm not really sure how that will affect this and indeed *how* it should affect this. I am not sure whether people are relying on the current behavior, or what use cases would be improved if we had a different behavior.

With regards to this:

> The documentation for getfile says "This will fail with a TypeError if the object is a built-in module, class, or function."

> https://docs.python.org/3/library/inspect.html#inspect.getfile

This is a bit unclear to me, and I'm not entirely sure if `datetime` qualifies. I think of built-in classes as things like `int` and `float`, and built-in functions as things like `abs` and `sum`, and `datetime` is an extension module — albeit one with a C implementation, and one that is in the standard library.

We should probably clarify the wording of `inspect.getsource` and determine what the intended semantics are for PEP-399-style modules, with both a C and pure Python implementation and the C implementation is what's being used. Error? Point to the Python implementation?
History
Date User Action Args
2020-08-27 21:16:52p-gansslesetrecipients: + p-ganssle, belopolsky, Aaron.Meurer, yselivanov, thatiparthy, corona10, xtreak, iritkatriel
2020-08-27 21:16:51p-gansslesetmessageid: <1598563011.92.0.793615950655.issue32313@roundup.psfhosted.org>
2020-08-27 21:16:51p-gansslelinkissue32313 messages
2020-08-27 21:16:51p-gansslecreate