File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,3 +19,19 @@ There are no plans to remove :term:`soft deprecated` APIs.
1919
2020 (Contributed by Gregory P. Smith in :gh: `86519 ` and
2121 Hugo van Kemenade in :gh: `148100 `.)
22+
23+ * The following typing-related classes are :term: `soft deprecated `:
24+
25+ * :class: `typing.Optional ` in favor of the dedicated union syntax
26+ (``X | None ``)
27+ * :class: `typing.NoReturn ` in favor of :class: `typing.Never `
28+ * :class: `typing.ForwardRef ` in favor of :class: `annotationlib.ForwardRef `
29+ * :class: `types.UnionType ` in favor of :class: `typing.Union ` (but see below)
30+
31+ Creating :class: `typing.Union ` instances using the constructor is also
32+ deprecated. Use the dedicated union syntax (``X | Y ``) instead.
33+
34+ Explicitly inheriting from :class: `typing.Generic ` is also deprecated.
35+ Use the dedicated syntax for :ref: `generic functions <generic-functions >`,
36+ :ref: `generic classes <generic-classes >`, and
37+ :ref: `generic type aliases <generic-type-aliases >` instead.
You can’t perform that action at this time.
0 commit comments