You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed result:
The __spec__.origin attribute of the _frozen_importlib module is None.
Expected result:
The __spec__.origin attribute of the _frozen_importlib module should be 'frozen', like it is already the case for the _frozen_importlib_external module and documented for all frozen modules in PEP-451: https://www.python.org/dev/peps/pep-0451/#origin
The language reference doesn't really have anything to say here. I think it wouldn't be difficult to add 'frozen' to the origin, but it should also be documented in the library reference (and of course, tested).
New changeset 69091cb by Barry Warsaw (Nina Zakharenko) in branch 'master': bpo-35321: Set the spec origin to frozen in frozen modules (bpo-11732) 69091cb
Activity
maggyero commentedon Nov 26, 2018
How to reproduce:
In Python:
Observed result:
The __spec__.origin attribute of the _frozen_importlib module is None.
Expected result:
The __spec__.origin attribute of the _frozen_importlib module should be 'frozen', like it is already the case for the _frozen_importlib_external module and documented for all frozen modules in PEP-451: https://www.python.org/dev/peps/pep-0451/#origin
brettcannon commentedon Nov 27, 2018
I can replicate.
Do note, though, that PEPs are not documentation once they are implemented; at that point the official docs are what should be followed.
warsaw commentedon Jan 18, 2019
Frozen module's origin isn't really documented AFAICT. Here's the link to the library reference:
https://docs.python.org/3/library/importlib.html?highlight=origin#importlib.machinery.ModuleSpec.origin
The language reference doesn't really have anything to say here. I think it wouldn't be difficult to add 'frozen' to the origin, but it should also be documented in the library reference (and of course, tested).
nnja commentedon Jan 18, 2019
I'll be happy to take a look at this.
warsaw commentedon Jan 18, 2019
I am mentoring Nina so I'll review this.
warsaw commentedon Feb 5, 2019
New changeset 69091cb by Barry Warsaw (Nina Zakharenko) in branch 'master':
bpo-35321: Set the spec origin to frozen in frozen modules (bpo-11732)
69091cb
brettcannon commentedon Feb 14, 2019
Can this be closed?
maggyero commentedon Feb 14, 2019
Yes, closed.