Brett Cannon <br...@python.org> added the comment: > 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 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33277> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com