[issue44318] Asyncio classes missing __slots__

Bluenix report at bugs.python.org
Thu Jun 17 06:37:21 EDT 2021


Bluenix <bluenixdev at gmail.com> added the comment:

My exact use-case is that I am subclassing asyncio.Semaphore to change some functionality (override `release()` to do nothing and set up tasks to schedule calls to reset the counter). I am expecting *a lot* of these instances so (like Serhiy Storchaka nicely put it) I would like to reduce the memory footprint of these classes by using __slots__. The issue now becomes that asyncio.Semaphore (like most other asyncio classes) have not defined __slots__, this prohibits my subclass from taking advantage of __slots__.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44318>
_______________________________________


More information about the Python-bugs-list mailing list