Skip to content

Commit

Permalink
pythonGH-65961: Document the deprecation of __package__ and `__cach…
Browse files Browse the repository at this point in the history
…ed__`
  • Loading branch information
brettcannon committed Sep 23, 2024
1 parent 7ee9921 commit 81e1418
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,8 @@ find and load modules.
.. attribute:: has_location

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


.. class:: AppleFrameworkLoader(name, path)
Expand Down
8 changes: 8 additions & 0 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@ listed below.
Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning`
when falling back to ``__package__``.

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


.. attribute:: __spec__

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

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

.. _package-path-rules:

module.__path__
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the setting and using ``__package__`` and ``__cached__``.

0 comments on commit 81e1418

Please sign in to comment.