mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
[3.13] GH-65961: Document the deprecation of __package__ and __cached__ (GH-124377) (#124380)
* GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)
The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.
(cherry picked from commit 67201ad53f)
---------
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Barry Warsaw <barry@python.org>
This commit is contained in:
parent
862ec8bd51
commit
cf98f39103
4 changed files with 12 additions and 3 deletions
|
|
@ -47,9 +47,6 @@ Pending Removal in Python 3.14
|
|||
* :mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils.localtime`.
|
||||
(Contributed by Alan Williams in :gh:`72346`.)
|
||||
|
||||
* :mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or
|
||||
taken into consideration by the import system (:gh:`97879`).
|
||||
|
||||
* :mod:`importlib.abc` deprecated classes:
|
||||
|
||||
* :class:`!importlib.abc.ResourceReader`
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ Pending Removal in Python 3.15
|
|||
* The :option:`!--cgi` flag to the :program:`python -m http.server`
|
||||
command-line interface has been deprecated since Python 3.13.
|
||||
|
||||
* :mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or
|
||||
taken into consideration by the import system (:gh:`97879`).
|
||||
|
||||
* :class:`locale`:
|
||||
|
||||
* The :func:`~locale.getdefaultlocale` function
|
||||
|
|
|
|||
|
|
@ -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__
|
||||
|
||||
|
|
@ -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
|
||||
``__cached__`` will cease to be set or taken into consideration
|
||||
by the import system or standard library.
|
||||
|
||||
.. _package-path-rules:
|
||||
|
||||
module.__path__
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Document the deprecation of setting and using ``__package__`` and ``__cached__``.
|
||||
Loading…
Add table
Add a link
Reference in a new issue