Or how to leverage constraints.
Try a datastruct instead of a namedtuple
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!
Try a datastruct instead of a namedtuple
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!