Message376014
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? |
|
Date |
User |
Action |
Args |
2020-08-27 21:16:52 | p-ganssle | set | recipients:
+ p-ganssle, belopolsky, Aaron.Meurer, yselivanov, thatiparthy, corona10, xtreak, iritkatriel |
2020-08-27 21:16:51 | p-ganssle | set | messageid: <1598563011.92.0.793615950655.issue32313@roundup.psfhosted.org> |
2020-08-27 21:16:51 | p-ganssle | link | issue32313 messages |
2020-08-27 21:16:51 | p-ganssle | create | |
|