simvx.core.graphics._slots¶
The attribute names a __slots__ class stores, for the copy protocols.
- class:
~simvx.core.graphics.texture.Textureand- class:
~simvx.core.graphics.material.Materialboth hand-roll__copy__,__deepcopy__and the pickle pair, and both need the same list. One helper, so a correction lands in one place.
Module Contents¶
Functions¶
Every attribute name cls stores in a slot, base classes included. |
Data¶
API¶
- simvx.core.graphics._slots.__all__¶
[‘slot_names’]
- simvx.core.graphics._slots.slot_names(cls: type) tuple[str, ...][source]¶
Every attribute name cls stores in a slot, base classes included.
The whole MRO is walked rather than one class’s
__slots__, so a subclass that adds slots of its own keeps them: backends subclass to add GPU state. Names are returned most-derived first and each appears once.Two spellings that a naive read of
__slots__gets wrong are handled here.__slots__ = "x"is a legal single-name form that iterates as characters, and a private name is mangled by the class body that declared it, so__slots__ = ("__x",)inFoocreates a slot called_Foo__x.