diff --git a/doc/index.rst b/doc/index.rst index 25785a58..780c5682 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -800,6 +800,30 @@ Special typing primitives Abstract Base Classes ~~~~~~~~~~~~~~~~~~~~~ +.. class:: AsyncContextManager + + See :py:class:`typing.AsyncContextManager`. In ``typing`` since 3.5.4 and 3.6.2. + + ``typing_extensions`` backports the optional second type parameter added + in Python 3.13. It specifies the type of the result of awaiting + ``__aexit__()`` and defaults to ``bool | None``. + + .. versionchanged:: 4.12.0 + + Added the second type parameter. + +.. class:: AsyncGenerator + + See :py:class:`typing.AsyncGenerator`. In ``typing`` since 3.6.1. + + ``typing_extensions`` backports the Python 3.13 default of ``None`` for + the second type parameter (the send type). This makes ``AsyncGenerator[int]`` + equivalent to ``AsyncGenerator[int, None]``. + + .. versionchanged:: 4.12.0 + + Made the second type parameter optional. + .. class:: Buffer See :py:class:`collections.abc.Buffer`. Added to the standard library @@ -807,6 +831,32 @@ Abstract Base Classes .. versionadded:: 4.6.0 +.. class:: ContextManager + + See :py:class:`typing.ContextManager`. In ``typing`` since 3.5.4. + + ``typing_extensions`` backports the optional second type parameter added + in Python 3.13. It specifies the return type of ``__exit__()`` and + defaults to ``bool | None``. + + .. versionchanged:: 4.12.0 + + Added the second type parameter. + +.. class:: Generator + + See :py:class:`typing.Generator`. In ``typing`` since 3.5. + + ``typing_extensions`` backports the Python 3.13 defaults for the second + (send) and third (return) type parameters. Both default to ``None``, so + ``Generator[int]`` is equivalent to ``Generator[int, None, None]``. + + .. versionadded:: 4.7.0 + + .. versionchanged:: 4.12.0 + + Made the second and third type parameters optional. + Protocols ~~~~~~~~~ @@ -1323,8 +1373,8 @@ Sentinel objects Pure aliases ~~~~~~~~~~~~ -Most of these are simply re-exported from the :mod:`typing` module on all supported -versions of Python, but all are listed here for completeness. +These names are re-exported directly from :mod:`typing` on all supported +versions of Python where they are available. .. class:: AbstractSet @@ -1338,23 +1388,6 @@ versions of Python, but all are listed here for completeness. .. versionadded:: 4.7.0 -.. class:: AsyncContextManager - - See :py:class:`typing.AsyncContextManager`. In ``typing`` since 3.5.4 and 3.6.2. - - .. versionchanged:: 4.12.0 - - ``AsyncContextManager`` now has an optional second parameter, defaulting to - ``Optional[bool]``, signifying the return type of the ``__aexit__`` method. - -.. class:: AsyncGenerator - - See :py:class:`typing.AsyncGenerator`. In ``typing`` since 3.6.1. - - .. versionchanged:: 4.12.0 - - The second type parameter is now optional (it defaults to ``None``). - .. class:: AsyncIterable See :py:class:`typing.AsyncIterable`. In ``typing`` since 3.5.2. @@ -1399,15 +1432,6 @@ versions of Python, but all are listed here for completeness. .. versionadded:: 4.7.0 -.. class:: ContextManager - - See :py:class:`typing.ContextManager`. In ``typing`` since 3.5.4. - - .. versionchanged:: 4.12.0 - - ``ContextManager`` now has an optional second parameter, defaulting to - ``Optional[bool]``, signifying the return type of the ``__exit__`` method. - .. class:: Coroutine See :py:class:`typing.Coroutine`. In ``typing`` since 3.5.3. @@ -1442,17 +1466,6 @@ versions of Python, but all are listed here for completeness. .. versionadded:: 4.7.0 -.. class:: Generator - - See :py:class:`typing.Generator`. - - .. versionadded:: 4.7.0 - - .. versionchanged:: 4.12.0 - - The second type and third type parameters are now optional - (they both default to ``None``). - .. class:: Generic See :py:class:`typing.Generic`.