@@ -2745,6 +2745,7 @@ Constant
2745
2745
.. versionadded :: 3.5.2
2746
2746
2747
2747
.. _generic-concrete-collections :
2748
+ .. _deprecated-typing-aliases :
2748
2749
2749
2750
Deprecated aliases
2750
2751
------------------
@@ -2753,16 +2754,21 @@ This module defines several deprecated aliases to pre-existing
2753
2754
standard library classes. These were originally included in the typing
2754
2755
module in order to support parameterizing these generic classes using ``[] ``.
2755
2756
However, the aliases became redundant in Python 3.9 when the
2756
- corresponding pre-existing classes were enhanced to support ``[] ``.
2757
+ corresponding pre-existing classes were enhanced to support ``[] `` (see
2758
+ :pep: `585 `).
2757
2759
2758
- The redundant types are deprecated as of Python 3.9 but no
2759
- deprecation warnings are issued by the interpreter.
2760
- It is expected that type checkers will flag the deprecated types
2761
- when the checked program targets Python 3.9 or newer .
2760
+ The redundant types are deprecated as of Python 3.9. However, while the aliases
2761
+ may be removed at some point, removal of these aliases is not currently
2762
+ planned. As such, no deprecation warnings are currently issued by the
2763
+ interpreter for these aliases .
2762
2764
2763
- The deprecated types will be removed from the :mod: `typing ` module
2764
- no sooner than the first Python version released 5 years after the release of Python 3.9.0.
2765
- See details in :pep: `585 `—*Type Hinting Generics In Standard Collections *.
2765
+ If at some point it is decided to remove these deprecated aliases, a
2766
+ deprecation warning will be issued by the interpreter for at least two releases
2767
+ prior to removal. The aliases are guaranteed to remain in the typing module
2768
+ without deprecation warnings until at least Python 3.14.
2769
+
2770
+ Type checkers are encouraged to flag uses of the deprecated types if the
2771
+ program they are checking targets a minimum Python version of 3.9 or newer.
2766
2772
2767
2773
.. _corresponding-to-built-in-types :
2768
2774
@@ -3295,16 +3301,26 @@ Certain features in ``typing`` are deprecated and may be removed in a future
3295
3301
version of Python. The following table summarizes major deprecations for your
3296
3302
convenience. This is subject to change, and not all deprecations are listed.
3297
3303
3298
- +----------------------------------+---------------+-------------------+----------------+
3299
- | Feature | Deprecated in | Projected removal | PEP/issue |
3300
- +==================================+===============+===================+================+
3301
- | ``typing.io `` and ``typing.re `` | 3.8 | 3.13 | :issue: `38291 ` |
3302
- | submodules | | | |
3303
- +----------------------------------+---------------+-------------------+----------------+
3304
- | ``typing `` versions of standard | 3.9 | Undecided | :pep: `585 ` |
3305
- | collections | | | |
3306
- +----------------------------------+---------------+-------------------+----------------+
3307
- | ``typing.ByteString `` | 3.9 | 3.14 | :gh: `91896 ` |
3308
- +----------------------------------+---------------+-------------------+----------------+
3309
- | ``typing.Text `` | 3.11 | Undecided | :gh: `92332 ` |
3310
- +----------------------------------+---------------+-------------------+----------------+
3304
+ .. list-table ::
3305
+ :header-rows: 1
3306
+
3307
+ * - Feature
3308
+ - Deprecated in
3309
+ - Projected removal
3310
+ - PEP/issue
3311
+ * - ``typing.io `` and ``typing.re `` submodules
3312
+ - 3.8
3313
+ - 3.13
3314
+ - :issue: `38291 `
3315
+ * - ``typing `` versions of standard collections
3316
+ - 3.9
3317
+ - Undecided (see :ref: `deprecated-typing-aliases ` for more information)
3318
+ - :pep: `585 `
3319
+ * - :class: `typing.ByteString `
3320
+ - 3.9
3321
+ - 3.14
3322
+ - :gh: `91896 `
3323
+ * - :data: `typing.Text `
3324
+ - 3.11
3325
+ - Undecided
3326
+ - :gh: `92332 `
0 commit comments