Cell class is defined as having
__slots__ = StyleableObject.__slots__ + ( # more stuff
Cell is a subclass of
StyleableObject this results in undefined behavior, and may be invalid code in the future. Per the Python docs:
If a class defines a slot also defined in a base class, the instance variable defined by the base class slot is inaccessible (except by retrieving its descriptor directly from the base class). This renders the meaning of the program undefined. In the future, a check may be added to prevent this.
Additionally, according to this SO answer, the redundant slots declaration may be wasting memory.
I think the fix is as easy as removing
StyleableObject.__slots__ + from the slot declaration