diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst index 245cb02d..b6f0b7aa 100644 --- a/docs/versionhistory.rst +++ b/docs/versionhistory.rst @@ -28,6 +28,8 @@ This library adheres to `Semantic Versioning 2.0 `_. - Emit a ``ResourceWarning`` for ``MemoryObjectReceiveStream`` and ``MemoryObjectSendStream`` that were garbage collected without being closed (PR by Andrey Kazantcev) +- Added ``__slots__`` to ``AsyncResource`` so that child classes can use ``__slots__`` + (`#733 `_; PR by Justin Su) **4.3.0** diff --git a/src/anyio/abc/_resources.py b/src/anyio/abc/_resources.py index 9693835b..10df115a 100644 --- a/src/anyio/abc/_resources.py +++ b/src/anyio/abc/_resources.py @@ -15,6 +15,8 @@ class AsyncResource(metaclass=ABCMeta): and calls :meth:`aclose` on exit. """ + __slots__ = () + async def __aenter__(self: T) -> T: return self