diff options
author | Grigoriev Semyon <33061489+grigoriev-semyon@users.noreply.github.com> | 2023-07-16 15:30:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-16 15:30:39 (GMT) |
commit | 55408f86d78259f18c56c5e1ea51e0f8dcdbeb67 (patch) | |
tree | bca94fcb70c1d427cb4a5864051aebcf303a3019 /Lib/contextlib.py | |
parent | cc25ca16ee406db936dfbd2337cbd14b12ccc4b7 (diff) | |
download | cpython-55408f86d78259f18c56c5e1ea51e0f8dcdbeb67.zip cpython-55408f86d78259f18c56c5e1ea51e0f8dcdbeb67.tar.gz cpython-55408f86d78259f18c56c5e1ea51e0f8dcdbeb67.tar.bz2 |
gh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManager` (#106771)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r-- | Lib/contextlib.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py index b5acbcb..95947ac 100644 --- a/Lib/contextlib.py +++ b/Lib/contextlib.py @@ -20,6 +20,8 @@ class AbstractContextManager(abc.ABC): __class_getitem__ = classmethod(GenericAlias) + __slots__ = () + def __enter__(self): """Return `self` upon entering the runtime context.""" return self @@ -42,6 +44,8 @@ class AbstractAsyncContextManager(abc.ABC): __class_getitem__ = classmethod(GenericAlias) + __slots__ = () + async def __aenter__(self): """Return `self` upon entering the runtime context.""" return self |