Paul Ganssle <p.gans...@gmail.com> added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

  • ... Irit Katriel
    • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి
    • ... Dong-hee Na
    • ... Paul Ganssle

Reply via email to