Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/third_party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# 3.9 is no longer supported. 3.14 fails some tests as of 2 November 2025
# 3.14 fails some tests as of 2 November 2025
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down Expand Up @@ -401,10 +401,6 @@ jobs:
- name: Run litestar tests with typing_extensions main branch
working-directory: litestar
run: |
# litestar's python-requires means uv won't let us add typing-extensions-latest
# as a requirement unless we do this
sed -i 's/^requires-python = ">=3.8/requires-python = ">=3.10/' pyproject.toml

uv add --editable ../typing-extensions-latest
uv sync

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ contributors need to sign the PSF Contributor Agreement.
# typing\_extensions

The `typing_extensions` module provides a way to access new features from the standard
library `typing` module in older versions of Python. For example, Python 3.10 adds
`typing.TypeGuard`, but users of older versions of Python can use `typing_extensions` to
use `TypeGuard` in their code even if they are unable to upgrade to Python 3.10.
library `typing` module in older versions of Python. For example, Python 3.13 adds
`typing.TypeIs`, but users of older versions of Python can use `typing_extensions` to
use `TypeIs` in their code even if they are unable to upgrade to Python 3.13.

If you contribute the runtime implementation of a new `typing` feature to CPython, you
are encouraged to also implement the feature in `typing_extensions`. Because the runtime
Expand Down
109 changes: 49 additions & 60 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ including those that have always been present in the module. This allows users t
import names from ``typing_extensions`` without having to remember exactly when
each object was added to :py:mod:`typing`. There are a few exceptions:
:py:class:`typing.ByteString`, which is deprecated and due to be removed in Python
3.14, is not re-exported. Similarly, the ``typing.io`` and ``typing.re`` submodules,
which are removed in Python 3.13, are excluded.
3.17, is not re-exported. Similarly, the ``typing.io`` and ``typing.re`` submodules,
which were removed in Python 3.13, are excluded.

Versioning and backwards compatibility
--------------------------------------
Expand Down Expand Up @@ -276,7 +276,7 @@ Python version in which each feature was added to :py:mod:`typing` and the
- 4.6.0
- :pep:`695`
* - :data:`TypeForm`
-
- 3.15
- 4.13.0
- :pep:`747`
* - :data:`TypeGuard`
Expand Down Expand Up @@ -335,14 +335,6 @@ on specific Python versions.
Special typing primitives
~~~~~~~~~~~~~~~~~~~~~~~~~

.. data:: Annotated

See :py:data:`typing.Annotated` and :pep:`593`. In ``typing`` since 3.9.

.. versionchanged:: 4.1.0

``Annotated`` can now wrap :data:`ClassVar` and :data:`Final`.

.. data:: Any

See :py:data:`typing.Any`.
Expand All @@ -358,12 +350,8 @@ Special typing primitives

See :py:data:`typing.Concatenate` and :pep:`612`. In ``typing`` since 3.10.

The backport does not support certain operations involving ``...`` as
a parameter; see :issue:`48` and :pr:`481` for details.

.. data:: Final

See :py:data:`typing.Final` and :pep:`591`. In ``typing`` since 3.8.
On Python 3.10, ``typing_extensions.Concatenate`` backports support for
``...`` as the last argument.

.. data:: Literal

Expand Down Expand Up @@ -426,8 +414,8 @@ Special typing primitives

See :py:class:`typing.NewType`. In ``typing`` since 3.5.2.

Instances of ``NewType`` were made picklable in 3.10 and an error message was
improved in 3.11; ``typing_extensions`` backports these changes.
On Python 3.10, ``typing_extensions.NewType`` backports the improved error
message from Python 3.11 for attempts to subclass a ``NewType`` instance.

.. versionchanged:: 4.6.0

Expand Down Expand Up @@ -460,11 +448,6 @@ Special typing primitives
The ``typing_extensions`` version adds support for the
``default=`` argument from :pep:`696`.

On older Python versions, ``typing_extensions.ParamSpec`` may not work
correctly with introspection tools like :func:`get_args` and
:func:`get_origin`. Certain special cases in user-defined
:py:class:`typing.Generic`\ s are also not available (e.g., see :issue:`126`).

.. versionchanged:: 4.4.0

Added support for the ``default=`` argument.
Expand Down Expand Up @@ -497,12 +480,6 @@ Special typing primitives
The ``infer_variance``, ``covariant``, and ``contravariant`` arguments are now
officially supported and their validation is improved.

.. class:: ParamSpecArgs
ParamSpecKwargs

See :py:class:`typing.ParamSpecArgs` and :py:class:`typing.ParamSpecKwargs`.
In ``typing`` since 3.10.

.. class:: Protocol

See :py:class:`typing.Protocol` and :pep:`544`. In ``typing`` since 3.8.
Expand Down Expand Up @@ -551,10 +528,6 @@ Special typing primitives

.. versionadded:: 4.0.0

.. data:: TypeAlias

See :py:data:`typing.TypeAlias` and :pep:`613`. In ``typing`` since 3.10.

.. class:: TypeAliasType(name, value, *, type_params=())

See :py:class:`typing.TypeAliasType` and :pep:`695`. In ``typing`` since 3.12.
Expand All @@ -563,14 +536,11 @@ Special typing primitives

.. data:: TypeForm

See :pep:`747`. A special form representing the value of a type expression.
See :py:data:`typing.TypeForm` and :pep:`747`. In ``typing`` since 3.15.
A special form representing the value of a type expression.

.. versionadded:: 4.13.0

.. data:: TypeGuard

See :py:data:`typing.TypeGuard` and :pep:`647`. In ``typing`` since 3.10.

.. data:: TypeIs

See :py:data:`typing.TypeIs` and :pep:`742`. In ``typing`` since 3.13.
Expand All @@ -588,9 +558,9 @@ Special typing primitives

Features backported by ``typing_extensions`` include:

* :py:class:`typing.TypedDict` does not store runtime information about which
(if any) keys are non-required in Python 3.8, and does not honor the
*total* keyword with old-style ``TypedDict()`` on Python 3.9.0 and 3.9.1.
* :py:class:`typing.TypedDict` ignores :data:`Required` and :data:`NotRequired`
when computing :py:attr:`~typing.TypedDict.__required_keys__` and
:py:attr:`~typing.TypedDict.__optional_keys__` on Python <3.11.
* :py:class:`typing.TypedDict` does not support multiple inheritance with
:py:class:`typing.Generic` on Python <3.11
* :py:class:`typing.TypedDict` classes do not consistently have the
Expand Down Expand Up @@ -789,7 +759,7 @@ Special typing primitives
``typing_extensions`` backports this change.

Generic type aliases involving ``Unpack`` may not work correctly on
Python 3.10 and lower; see :issue:`103` for details.
Python 3.10; see :issue:`103` for details.

.. versionadded:: 4.1.0

Expand Down Expand Up @@ -1003,7 +973,8 @@ Functions
but unlike that method, :func:`!evaluate_forward_ref` also:

* Recursively evaluates forward references nested within the type hint.
However, the amount of recursion is limited in Python 3.8 and 3.10.
On Python 3.10, string references nested in built-in generic aliases
such as ``list['str']`` can remain unresolved.
* Raises :exc:`TypeError` when it encounters certain objects that are
not valid type hints.
* Replaces type hints that evaluate to :const:`!None` with
Expand Down Expand Up @@ -1055,22 +1026,6 @@ Functions

.. versionadded:: 4.13.0

.. function:: get_args(tp)

See :py:func:`typing.get_args`. In ``typing`` since 3.8.

This function was changed in 3.9 and 3.10 to deal with :data:`Annotated`
and :class:`ParamSpec` correctly; ``typing_extensions`` backports these
fixes.

.. function:: get_origin(tp)

See :py:func:`typing.get_origin`. In ``typing`` since 3.8.

This function was changed in 3.9 and 3.10 to deal with :data:`Annotated`
and :class:`ParamSpec` correctly; ``typing_extensions`` backports these
fixes.

.. function:: get_original_bases(cls)

See :py:func:`types.get_original_bases`. Added to the standard library
Expand Down Expand Up @@ -1332,6 +1287,14 @@ versions of Python, but all are listed here for completeness.

.. versionadded:: 4.7.0

.. data:: Annotated

See :py:data:`typing.Annotated` and :pep:`593`. In ``typing`` since 3.9.

.. versionchanged:: 4.1.0

``Annotated`` can now wrap :data:`ClassVar` and :data:`Final`.

.. data:: AnyStr

See :py:data:`typing.AnyStr`.
Expand Down Expand Up @@ -1430,6 +1393,10 @@ versions of Python, but all are listed here for completeness.

.. versionadded:: 4.7.0

.. data:: Final

See :py:data:`typing.Final` and :pep:`591`. In ``typing`` since 3.8.

.. class:: ForwardRef

See :py:class:`typing.ForwardRef`.
Expand Down Expand Up @@ -1551,6 +1518,12 @@ versions of Python, but all are listed here for completeness.

See :py:class:`typing.OrderedDict`. In ``typing`` since 3.7.2.

.. class:: ParamSpecArgs
ParamSpecKwargs

See :py:class:`typing.ParamSpecArgs` and :py:class:`typing.ParamSpecKwargs`.
In ``typing`` since 3.10.

.. class:: Pattern

See :py:class:`typing.Pattern`.
Expand Down Expand Up @@ -1601,10 +1574,18 @@ versions of Python, but all are listed here for completeness.

See :py:class:`typing.Type`. In ``typing`` since 3.5.2.

.. data:: TypeAlias

See :py:data:`typing.TypeAlias` and :pep:`613`. In ``typing`` since 3.10.

.. data:: TYPE_CHECKING

See :py:data:`typing.TYPE_CHECKING`. In ``typing`` since 3.5.2.

.. data:: TypeGuard

See :py:data:`typing.TypeGuard` and :pep:`647`. In ``typing`` since 3.10.

.. data:: Union

See :py:class:`typing.Union`.
Expand All @@ -1623,6 +1604,14 @@ versions of Python, but all are listed here for completeness.

.. versionadded:: 4.7.0

.. function:: get_args(tp)

See :py:func:`typing.get_args`. In ``typing`` since 3.8.

.. function:: get_origin(tp)

See :py:func:`typing.get_origin`. In ``typing`` since 3.8.

.. decorator:: no_type_check

See :py:func:`typing.no_type_check`.
Expand Down
Loading
Loading