8000 Added `__slots__` to `AsyncResource` (#733) · IBMZ-Linux-OSS-Python/anyio@dfc44cf · GitHub
[go: up one dir, main page]

Skip to content

Commit dfc44cf

Browse files
authored
Added __slots__ to AsyncResource (agronholm#733)
1 parent 96920b0 commit dfc44cf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/versionhistory.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
2828
- Emit a ``ResourceWarning`` for ``MemoryObjectReceiveStream`` and
2929
``MemoryObjectSendStream`` that were garbage collected without being closed (PR by
3030
Andrey Kazantcev)
31+
- Added ``__slots__`` to ``AsyncResource`` so that child classes can use ``__slots__``
32+
(`#733 <https://github.com/agronholm/anyio/pull/733>`_; PR by Justin Su)
3133

3234
**4.3.0**
3335

src/anyio/abc/_resources.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class AsyncResource(metaclass=ABCMeta):
1515
and calls :meth:`aclose` on exit.
1616
"""
1717

18+
__slots__ = ()
19+
1820
async def __aenter__(self: T) -> T:
1921
return self
2022

0 commit comments

Comments
 (0)
0