Message398938
> Maybe this can be revisited now.
I've started the work already (albeit rather slowly 😄). Importlib has been updated to prefer __spec__.parent of __package__ and warns when the values are not equal. Next step will be to raise an ImportWarning when __package__ is defined but __spec__.parent is not (then DeprecationWarning after that).
For __loader__ I got Python 3.10 to fall back on to __spec__.loader. Next step is https://bugs.python.org/issue42132 to update C code to set __spec__ where appropriate. From there the check for equivalence can go in (which then leads to the warnings).
I have not started with __cached__ yet, so next step is making sure all uses fall back on __spec__.
So, to be clear, the steps I have been following are:
1. Make sure all code falls back on __spec__ when appropriate (one release)
2. Raise an ImportWarning when values differ (one release)
3. Make __spec__ take precedence over old attribute (one release)
4. Raise an ImportWarning when having to fall back to older attribute (two releases)
5. Raise a DeprecationWarning when falling back on older attribute (two releases)
6. Clean up code |
|
Date |
User |
Action |
Args |
2021-08-04 19:03:50 | brett.cannon | set | recipients:
+ brett.cannon, barry, rhettinger, ncoghlan, pitrou, pmpp, eric.snow, iritkatriel |
2021-08-04 19:03:50 | brett.cannon | set | messageid: <1628103830.55.0.413330673718.issue33277@roundup.psfhosted.org> |
2021-08-04 19:03:50 | brett.cannon | link | issue33277 messages |
2021-08-04 19:03:50 | brett.cannon | create | |
|