@@ -18,18 +18,23 @@ Utilities
18
18
19
19
Functions and classes provided:
20
20
21
- .. class :: AbstractContextManager
21
+ .. class :: AbstractContextManager[T_co, ExitT_co]
22
22
23
23
An :term: `abstract base class ` for classes that implement
24
24
:meth: `object.__enter__ ` and :meth: `object.__exit__ `. A default
25
25
implementation for :meth: `object.__enter__ ` is provided which returns
26
26
``self `` while :meth: `object.__exit__ ` is an abstract method which by default
27
27
returns ``None ``. See also the definition of :ref: `typecontextmanager `.
28
28
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
+
29
34
.. versionadded :: 3.6
30
35
31
36
32
- .. class :: AbstractAsyncContextManager
37
+ .. class :: AbstractAsyncContextManager[T_co, AExitT_co]
33
38
34
39
An :term: `abstract base class ` for classes that implement
35
40
:meth: `object.__aenter__ ` and :meth: `object.__aexit__ `. A default
@@ -38,6 +43,11 @@ Functions and classes provided:
38
43
returns ``None ``. See also the definition of
39
44
:ref: `async-context-managers `.
40
45
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
+
41
51
.. versionadded :: 3.7
42
52
43
53
0 commit comments