8000 Do the same with `contextlib` references · python/cpython@3a71312 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a71312

Browse files
committed
Do the same with contextlib references
1 parent 412c358 commit 3a71312

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Doc/library/contextlib.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@ Utilities
1818

1919
Functions and classes provided:
2020

21-
.. class:: AbstractContextManager
21+
.. class:: AbstractContextManager[T_co, ExitT_co]
2222

2323
An :term:`abstract base class` for classes that implement
2424
:meth:`object.__enter__` and :meth:`object.__exit__`. A default
2525
implementation for :meth:`object.__enter__` is provided which returns
2626
``self`` while :meth:`object.__exit__` is an abstract method which by default
2727
returns ``None``. See also the definition of :ref:`typecontextmanager`.
2828

29+
The first type parameter, ``T_co``, represents the type returned by
30+
the :meth:`~object.__enter__` method. The optional second type parameter, ``ExitT_co``,
31+
which defaults to ``bool | None``, represents the type returned by the
32+
:meth:`~object.__exit__` method.
33+
2934
.. versionadded:: 3.6
3035

3136

32-
.. class:: AbstractAsyncContextManager
37+
.. class:: AbstractAsyncContextManager[T_co, AExitT_co]
3338

3439
An :term:`abstract base class` for classes that implement
3540
:meth:`object.__aenter__` and :meth:`object.__aexit__`. A default
@@ -38,6 +43,11 @@ Functions and classes provided:
3843
returns ``None``. See also the definition of
3944
:ref:`async-context-managers`.
4045

46+
The first type parameter, ``T_co``, represents the type returned by
47+
the :meth:`~object.__aenter__` method. The optional second type parameter, ``AExitT_co``,
48+
which defaults to ``bool | None``, represents the type returned by the
49+
:meth:`~object.__aexit__` method.
50+
4151
.. versionadded:: 3.7
4252

4353

Doc/library/typing.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,11 +3732,6 @@ Aliases to :mod:`contextlib` ABCs
37323732

37333733
Deprecated alias to :class:`contextlib.AbstractContextManager`.
37343734

3735-
The first type parameter, ``T_co``, represents the type returned by
3736-
the :meth:`~object.__enter__` method. The optional second type parameter, ``ExitT_co``,
3737-
which defaults to ``bool | None``, represents the type returned by the
3738-
:meth:`~object.__exit__` method.
3739-
37403735
.. versionadded:: 3.5.4
37413736

37423737
.. deprecated:: 3.9
@@ -3751,11 +3746,6 @@ Aliases to :mod:`contextlib` ABCs
37513746

37523747
Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`.
37533748

3754-
The first type parameter, ``T_co``, represents the type returned by
3755-
the :meth:`~object.__aenter__` method. The optional second type parameter, ``AExitT_co``,
3756-
which defaults to ``bool | None``, represents the type returned by the
3757-
:meth:`~object.__aexit__` method.
3758-
37593749
.. versionadded:: 3.6.2
37603750

37613751
.. deprecated:: 3.9

0 commit comments

Comments
 (0)
0