Closed anton-ryzhov closed 7 months ago
I've noticed that __slots__ are defined in Message-classes, but they were not working as expected.
__slots__
Message
When inheriting from a class without slots, the dict and weakref attribute of the instances will always be accessible.
https://docs.python.org/3/reference/datamodel.html?#object.__slots__
So all parent classes must also have __slots__ to disable __dict__ creation. That's what I did in this PR
__dict__
coverage: 88.434% (+0.03%) from 88.402% when pulling c4d59b1e1defbed380d1c2781957408049ab9080 on anton-ryzhov:define-slots into 3352ce4594621a027177fe2efecf7f4cb3fa8125 on mosquito:master.
Done
I've noticed that
__slots__
are defined inMessage
-classes, but they were not working as expected.https://docs.python.org/3/reference/datamodel.html?#object.__slots__
So all parent classes must also have
__slots__
to disable__dict__
creation. That's what I did in this PR