gh-94619: Remove long deprecated methods module_repr() and load_module() (#94624)

* gh-94619: Remove long deprecated methods module_repr() and load_module()

Closes #94619

* Update Misc/NEWS.d/next/Library/2022-07-06-14-57-33.gh-issue-94619.PRqKVX.rst

Fix typo

Co-authored-by: Brett Cannon <brett@python.org>

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Barry Warsaw 2022-08-04 17:24:26 -07:00 committed by GitHub
parent 44f1f63ad5
commit e1182bc377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 11 additions and 180 deletions

View file

@ -676,22 +676,10 @@ Here are the exact rules used:
* Otherwise, just use the module's ``__name__`` in the repr.
.. versionchanged:: 3.4
Use of :meth:`loader.module_repr() <importlib.abc.Loader.module_repr>`
has been deprecated and the module spec is now used by the import
machinery to generate a module repr.
For backward compatibility with Python 3.3, the module repr will be
generated by calling the loader's
:meth:`~importlib.abc.Loader.module_repr` method, if defined, before
trying either approach described above. However, the method is deprecated.
.. versionchanged:: 3.10
Calling :meth:`~importlib.abc.Loader.module_repr` now occurs after trying to
use a module's ``__spec__`` attribute but before falling back on
``__file__``. Use of :meth:`~importlib.abc.Loader.module_repr` is slated to
stop in Python 3.12.
.. versionchanged:: 3.12
Use of :meth:`module_repr`, having been deprecated since Python 3.4, was
removed in Python 3.12 and is no longer called during the resolution of a
module's repr.
.. _pyc-invalidation: