summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2024-05-07 14:16:05 (GMT)
committerGitHub <noreply@github.com>2024-05-07 14:16:05 (GMT)
commit71080b8a0fe5da46fb97659060db76fd95a3fb61 (patch)
tree3551c62ad58d442e3764bd5d73d3d9ad60240a7c /Lib/typing.py
parenta855f824a2f5a310ffa58a973a8fe9feaa2500b3 (diff)
downloadcpython-71080b8a0fe5da46fb97659060db76fd95a3fb61.zip
cpython-71080b8a0fe5da46fb97659060db76fd95a3fb61.tar.gz
cpython-71080b8a0fe5da46fb97659060db76fd95a3fb61.tar.bz2
gh-118660: Add second type parameter to (Async)ContextManager (#118681)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index e485836..8e61f50 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -3783,7 +3783,7 @@ def __getattr__(attr):
obj = _alias(getattr(re, attr), 1)
elif attr in {"ContextManager", "AsyncContextManager"}:
import contextlib
- obj = _alias(getattr(contextlib, f"Abstract{attr}"), 1, name=attr)
+ obj = _alias(getattr(contextlib, f"Abstract{attr}"), 2, name=attr, defaults=(bool | None,))
else:
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
globals()[attr] = obj