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

Skip to content

Commit fb13736

Browse files
committed
Revert "Do the same with contextlib references"
Similarly to `collections.abc` changes, this is not acceptable for now.
1 parent 5aa430c commit fb13736

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Doc/library/contextlib.rst

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

1919
Functions and classes provided:
2020

21-
.. class:: AbstractContextManager[T_co, ExitT_co]
21+
.. class:: AbstractContextManager
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-
3429
.. versionadded:: 3.6
3530

3631

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

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

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-
5141
.. versionadded:: 3.7
5242

5343

Doc/library/typing.rst

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

38133813
Deprecated alias to :class:`contextlib.AbstractContextManager`.
38143814

3815+
The first type parameter, ``T_co``, represents the type returned by
3816+
the :meth:`~object.__enter__` method. The optional second type parameter, ``ExitT_co``,
3817+
which defaults to ``bool | None``, represents the type returned by the
3818+
:meth:`~object.__exit__` method.
3819+
38153820
.. versionadded:: 3.5.4
38163821

38173822
.. deprecated:: 3.9
@@ -3826,6 +3831,11 @@ Aliases to :mod:`contextlib` ABCs
38263831

38273832
Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`.
38283833

3834+
The first type parameter, ``T_co``, represents the type returned by
3835+
the :meth:`~object.__aenter__` method. The optional second type parameter, ``AExitT_co``,
3836+
which defaults to ``bool | None``, represents the type returned by the
3837+
:meth:`~object.__aexit__` method.
3838+
38293839
.. versionadded:: 3.6.2
38303840

38313841
.. deprecated:: 3.9

0 commit comments

Comments
 (0)
0