__slots__ variable in Python classes
Tue Jun 18 2024 16:44:52 GMT+0000 (Coordinated Universal Time)
__slots__ is a special class variable in Python that restricts the attributes that can be assigned to an instance of a class. If __slots__ is defined, an exception will be raised if an attribute that is not in the list is assigned to an instance.
https://www.pynerds.com/slots-variable-in-python-classes/
Comments