dispatchrun / dispatch-py

Python package to develop applications with Dispatch.
https://pypi.org/project/dispatch-py/
Apache License 2.0
56 stars 3 forks source link

all: add slots declarations #74

Closed achille-roussel closed 8 months ago

achille-roussel commented 8 months ago

This will help ensure we are correctly accessing fields that are explicitly declared. It also has memory footprint implications since the interpreter avoids creating a dictionary to maintain the state of the objects.

Where available, I configured the @dataclass decorator to automatically generate the __slots__ attribute. In the few other places where we weren't using @dataclass, I declared the slots explicitly.