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
No my bad, the title is misleading :') it's only if setting the attribute on __spec__ failed that we would not allow setting it otherwise. The exact description is in pending-removal-in-315 but I would like the feedback from an importlib expert.
changed the title [-]Remove support for `__cached__` and `__package__` on specless modules[/-][+]Remove support for `__cached__` and `__package__` if missing corresponding `__spec__` attributes[/+]on May 20, 2025
FYI __package__ and __cached__ are slated for removal in 3.15 (although being slated for removal doesn't mean Barry and I will get to it at the core dev sprints which is our traditional time to try and remove those attributes 😅).
Oh. So let's first remove the different mentions to this removal (I haven't worked at all on this one because I didn't know what to do and how to do it as well) maybe?
Activity
mkaraev commentedon May 16, 2025
picnixz commentedon May 16, 2025
xuantengh commentedon May 20, 2025
Hi I'd like to work on this. Does it mean for modules without
__spec__
, we do not set__cached__
nor__package__
for them?picnixz commentedon May 20, 2025
No my bad, the title is misleading :') it's only if setting the attribute on
__spec__
failed that we would not allow setting it otherwise. The exact description is in pending-removal-in-315 but I would like the feedback from an importlib expert.[-]Remove support for `__cached__` and `__package__` on specless modules[/-][+]Remove support for `__cached__` and `__package__` if missing corresponding `__spec__` attributes[/+]brettcannon commentedon May 22, 2025
FYI
__package__
and__cached__
are slated for removal in 3.15 (although being slated for removal doesn't mean Barry and I will get to it at the core dev sprints which is our traditional time to try and remove those attributes 😅).serhiy-storchaka commentedon May 31, 2025
It cannot be done now, because the deprecation was not complete. The warnings were emitted not in all cases. See #122255.
We first need to start emitting deprecation warnings in all cases, this will restart the deprecation period.
picnixz commentedon May 31, 2025
Oh. So let's first remove the different mentions to this removal (I haven't worked at all on this one because I didn't know what to do and how to do it as well) maybe?