O'Reilly logo
  • You Wang thinks this is interesting:

If we only need objects where we access the original attributes and don’t need to add or remove attributes, we can create classes that don’t have a __dict__. This is achieved simply by defining a class attribute called __slots__ whose value is a tuple of attribute names. Each object of such a class will have attributes of the specified names and no __dict__; no attributes can be added or removed from such classes. These objects consume less memory and are faster than conventional objects, although this is unlikely to make much difference unless large numbers of objects are created. If we inherit from a class that uses __slots__ we must declare slots in our subcla...


Cover of Programming in Python 3: A Complete Introduction to the Python Language, Second Edition


So slot is saying the memory layout is fixed, no need to keep record of change.