2 Comments
User's avatar
Q QQ's avatar

Try a datastruct instead of a namedtuple

Expand full comment
Taras Tsugrii's avatar

You've probably meant @dataclass from dataclasses module :) By default dataclass decorator would still use __dict__ and take extra memory, but there is a way to make it use slots and I'll cover this in my next post. Thanks for the suggestion!

Expand full comment