instance __dict__and may even imply its absencenew-style classes must instead generally run attribute assignments by routing them to the object superclass in practicethis may make this method fundamentally different in some classic and new-style classes slot usage rules slot declarations can appear in multiple classes in class treebut when they do they are subject to number of constraints that are somewhat difficult to rationalize unless you understand the implementation of slots as class-level descriptors for each slot name that are inherited by the instances where the managed space is reserved (descriptors are an advanced tool we'll study in detail in the last part of this book)slots in subs are pointless when absent in supersif subclass inherits from superclass without __slots__the instance __dict__ attribute created for the superclass will always be accessiblemaking __slots__ in the subclass largely pointless the subclass still manages its slotsbut doesn' compute their values in any wayand doesn' avoid dictionary--the main reason to use slots slots in supers are pointless when absent in subssimilarlybecause the meaning of __slots__ declaration is limited to the class in which it appearssubclasses will produce an instance __dict__ if they do not define __slots__rendering __slots__ in superclass largely pointless redefinition renders super slots pointlessif class defines the same slot name as superclassits redefinition hides the slot in the superclass per normal inheritance you can access the version of the name defined by the superclass slot only by fetching its descriptor directly from the superclass slots prevent class-level defaultsbecause slots are implemented as class-level descriptors (along with per-instance space)you cannot use class attributes of the same name to provide defaults as you can for normal instance attributesassigning the same name in the class overwrites the slot descriptor slots and __dict__as shown earlier__slots__ preclude both an instance __dict__ and assigning names not listedunless __dict__ is listed explicitly too we've already seen the last of these in actionand the earlier mapattrs-slots py illustrates the third it' easy to demonstrate how the new rules here translate to actual code-most cruciallya namespace dictionary is created when any class in tree omits slotsthereby negating the memory optimization benefitclass cpass class ( )__slots__ [' ' ( __dict__ {' ' __dict__ keys( advanced class topics bullet slots in sub but not super makes instance dict for nonslots but slot name still managed in class