4.16.0rc1
Pre-release
Pre-release
- Make
typing_extensions.TypeAliasType's__module__attribute writable. Backport of CPython PR #149172. - Fix setting of
__required_keys__and__optional_keys__when inheriting keys with the same name. - Add support for
AsyncIterator,io.Reader,io.Writerandos.PathLikeprotocols as bases for other protocols. - Fix incorrect behaviour on Python 3.9 and Python 3.10 that meant that calling
isinstancewithtyping_extensions.Concatenate[...]ortyping_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 usingsys.setprofile. This affected both CPython and PyPy implementations. Patch by Brian Schubert. - Fix
__init_subclass__()behavior in the presence of multiple inheritance involving an@deprecated-decorated base class. Backport of CPython PR #138210 by Brian Schubert. - Raise
TypeErrorwhen attempting to subclasstyping_extensions.ParamSpecon Python 3.9. Thetypingimplementation has always raised an error, and thetyping_extensionsimplementation has raised an error on Python 3.10+ sincetyping_extensionsv4.6.0. Patch by Brian Schubert. - Add the
bound,covariant,contravariant, andinfer_varianceparameters toTypeVarTuple. - Officially support the
bound,covariant,contravariantandinfer_varianceparameters toParamSpec. Improve the validation of these parameters at runtime. - Rename
typing_extensions.Sentineltotyping_extensions.sentinel, following the name that has been adopted forbuiltins.sentinelon Python 3.15.typing_extensions.Sentinelis retained as a soft-deprecated alias for backwards compatibility. - Add support for pickling sentinels.
- Sentinels now preserve their identity when copied or deep-copied.
- Deprecate passing
nameas a keyword argument orrepras a positional argument to thesentinelconstructor. - The default repr of a sentinel
X = sentinel("X")is nowXrather than<X>. - Deprecate arbitrary attribute assignments to sentinels.
- Deprecate subclassing sentinels.
- Add support for Python 3.15.