Skip to content

Commit 81e1418

Browse files
committed
pythonGH-65961: Document the deprecation of __package__ and __cached__
1 parent 7ee9921 commit 81e1418

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Doc/library/importlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,8 @@ find and load modules.
12371237
.. attribute:: has_location
12381238

12391239
``True`` if the spec's :attr:`origin` refers to a loadable location,
1240-
``False`` otherwise. This value impacts how :attr:`origin` is interpreted
1241-
and how the module's :attr:`__file__` is populated.
1240+
``False`` otherwise. This value impacts how :attr:`origin` is interpreted
1241+
and how the module's :attr:`__file__` is populated.
12421242

12431243

12441244
.. class:: AppleFrameworkLoader(name, path)

Doc/reference/import.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ listed below.
596596
Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning`
597597
when falling back to ``__package__``.
598598

599+
.. deprecated-removed:: 3.13 3.15
600+
``__package__`` will cease to be set or taken into consideration
601+
by the import system or standard library.
602+
599603

600604
.. attribute:: __spec__
601605

@@ -653,6 +657,10 @@ listed below.
653657
It is **strongly** recommended that you rely on :attr:`__spec__`
654658
instead of ``__cached__``.
655659

660+
.. deprecated-removed:: 3.13 3.15
661+
``__package__`` will cease to be set or taken into consideration
662+
by the import system or standard library.
663+
656664
.. _package-path-rules:
657665

658666
module.__path__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate the setting and using ``__package__`` and ``__cached__``.

0 commit comments

Comments
 (0)