__slots__ memory optimization in Python
Illustration from realpython.com The other day, while working on fpdf2, I used @dataclass, a nice decorator that came in the standard library with Python 3.7, to quickly define a class that mostly stored data. Then a question came to my mind: is the __slots__ memory optimization compatible with …
Read More