Backported and experimental type hints for Python
Repo python/typing_extensions, read from GitHub 21 h ago. python has not joined Take My Repo.
No changes since 4.16.0rc2.
Changes since 4.15.0:
typing_extensions.TypeAliasType's __module__ attribute writable. Backport of CPython PR #149172.__required_keys__ and __optional_keys__ when inheriting keys with the same name.AsyncIterator, io.Reader, io.Writer and os.PathLike protocols as bases for other protocols.isinstance with typing_extensions.Concatenate[...] or typing_extensions.Unpack[...] as the first argument could have a different result in some situations depending on whether or not a profiling function had been set using sys.setprofile. This affected both CPython and PyPy implementations. Patch by Brian Schubert.__init_subclass__() behavior in the presence of multiple inheritance involving an @deprecated-decorated base class. Backport of CPython PR #138210 by Brian Schubert.TypeError when attempting to subclass typing_extensions.ParamSpec on Python 3.9. The typing implementation has always raised an error, and the typing_extensions implementation has raised an error on Python 3.10+ since typing_extensions v4.6.0. Patch by Brian Schubert.bound, covariant, contravariant, and infer_variance parameters to TypeVarTuple.bound, covariant, contravariant and infer_variance parameters to ParamSpec. Improve the validation of these parameters at runtime.typing_extensions.Sentinel to typing_extensions.sentinel, following the name that has been adopted for builtins.sentinel on Python 3.15. typing_extensions.Sentinel is retained as a soft-deprecated alias for backwards compatibility.name as a keyword argument or repr as a positional argument to the sentinel constructor.X = sentinel("X") is now X rather than <X>.DeprecationWarning when deprecated is applied to a coroutine function on Python 3.14.0.Changes since 4.16.0rc1:
DeprecationWarning when deprecated is applied to a coroutine function on Python 3.14.0.Changes since 4.15.0:
typing_extensions.TypeAliasType's __module__ attribute writable. Backport of CPython PR #149172.__required_keys__ and __optional_keys__ when inheriting keys with the same name.AsyncIterator, io.Reader, io.Writer and os.PathLike protocols as bases for other protocols.isinstance with typing_extensions.Concatenate[...] or typing_extensions.Unpack[...] as the first argument could have a different result in some situations depending on whether or not a profiling function had been set using sys.setprofile. This affected both CPython and PyPy implementations. Patch by Brian Schubert.__init_subclass__() behavior in the presence of multiple inheritance involving an @deprecated-decorated base class. Backport of CPython PR #138210 by Brian Schubert.TypeError when attempting to subclass typing_extensions.ParamSpec on Python 3.9. The typing implementation has always raised an error, and the typing_extensions implementation has raised an error on Python 3.10+ since typing_extensions v4.6.0. Patch by Brian Schubert.bound, covariant, contravariant, and infer_variance parameters to TypeVarTuple.bound, covariant, contravariant and infer_variance parameters to ParamSpec. Improve the validation of these parameters at runtime.typing_extensions.Sentinel to typing_extensions.sentinel, following the name that has been adopted for builtins.sentinel on Python 3.15. typing_extensions.Sentinel is retained as a soft-deprecated alias for backwards compatibility.name as a keyword argument or repr as a positional argument to the sentinel constructor.X = sentinel("X") is now X rather than <X>.typing_extensions.TypeAliasType's __module__ attribute writable. Backport of CPython PR #149172.__required_keys__ and __optional_keys__ when inheriting keys with the same name.AsyncIterator, io.Reader, io.Writer and os.PathLike protocols as bases for other protocols.isinstance with typing_extensions.Concatenate[...] or typing_extensions.Unpack[...] as the first argument could have a different result in some situations depending on whether or not a profiling function had been set using sys.setprofile. This affected both CPython and PyPy implementations. Patch by Brian Schubert.__init_subclass__() behavior in the presence of multiple inheritance involving an @deprecated-decorated base class. Backport of CPython PR #138210 by Brian Schubert.TypeError when attempting to subclass typing_extensions.ParamSpec on Python 3.9. The typing implementation has always raised an error, and the typing_extensions implementation has raised an error on Python 3.10+ since typing_extensions v4.6.0. Patch by Brian Schubert.bound, covariant, contravariant, and infer_variance parameters to TypeVarTuple.bound, covariant, contravariant and infer_variance parameters to ParamSpec. Improve the validation of these parameters at runtime.typing_extensions.Sentinel to typing_extensions.sentinel, following the name that has been adopted for builtins.sentinel on Python 3.15. typing_extensions.Sentinel is retained as a soft-deprecated alias for backwards compatibility.name as a keyword argument or repr as a positional argument to the sentinel constructor.X = sentinel("X") is now X rather than <X>.No user-facing changes since 4.15.0rc1.
New features since 4.14.1:
@typing_extensions.disjoint_base decorator, as specifiedtyping_extensions.type_repr, a backport ofannotationlib.type_repr,typing_extensions.evaluate_forward_ref. Backport of@typing_extensions.disjoint_base decorator, as specifiedtyping_extensions.type_repr, a backport ofannotationlib.type_repr,typing_extensions.evaluate_forward_ref. Backport oftyping_extensions.TypedDict nested inside other typestyping.Type[typing_extensions.TypedDict]). This is not allowed by the