summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2021-03-26 18:55:07 (GMT)
committerGitHub <noreply@github.com>2021-03-26 18:55:07 (GMT)
commit1899087b21119c5c64cd41619b542c0bf0ab5751 (patch)
tree400c834041ef28eacaac8fa0169e2482dea8a775 /Doc
parent21a2cabb3795f5170c746ab8f29e9d25c7442550 (diff)
downloadcpython-1899087b21119c5c64cd41619b542c0bf0ab5751.zip
cpython-1899087b21119c5c64cd41619b542c0bf0ab5751.tar.gz
cpython-1899087b21119c5c64cd41619b542c0bf0ab5751.tar.bz2
bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/reference/import.rst7
-rw-r--r--Doc/whatsnew/3.10.rst6
2 files changed, 13 insertions, 0 deletions
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst
index c595242..b5ac21d 100644
--- a/Doc/reference/import.rst
+++ b/Doc/reference/import.rst
@@ -675,6 +675,13 @@ Here are the exact rules used:
: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.
+
.. _pyc-invalidation:
Cached bytecode invalidation
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 30bc35d..1c4e5c4 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -1010,6 +1010,12 @@ Deprecated
for Python 3.12.
(Contributed by Brett Cannon in :issue:`42137`.)
+* :meth:`importlib.abc.Loader.module_repr`,
+ :meth:`importlib.machinery.FrozenLoader.module_repr`, and
+ :meth:`importlib.machinery.BuiltinLoader.module_repr` are deprecated and
+ slated for removal in Python 3.12.
+ (Contributed by Brett Cannon in :issue:`42136`.)
+
* ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python
3.3, when it was made an alias to :class:`str`. It is now deprecated,
scheduled for removal in Python 3.12.