class c__slots__ [' 'class ( )pass ( __dict__ {' ' __dict__ keys(dict_keys(' ''__slots__']bullet slots in super but not sub makes instance dict for nonslots but slot name still managed in class class c__slots__ [' 'class ( )__slots__ [' 'bullet only lowest slot accessible class c__slots__ [' '] bullet no class-level defaults valueerror'ain __slots__ conflicts with class variable in other wordsbesides their program-breaking potentialslots essentially require both universal and careful deployment to be effective--because slots do not compute values dynamically like properties (coming up in the next section)they are largely pointless unless each class in tree uses them and is cautious to define only new slot names not defined by other classes it' an all-or-nothing feature--an unfortunate property shared by the super call discussed aheadclass c__slots__ [' 'assumes universal usediffering names class ( )__slots__ [' ' ( __dict__ attributeerror'dobject has no attribute '__dict__c __dict__ keys() __dict__ keys((dict_keys(' ''__slots__'])dict_keys(' ''__slots__'])such rules--among others regarding weak references omitted here for space--are part of the reason slots are not generally recommendedexcept in pathological cases where their space reduction is significant even thentheir potential to complicate or break code should be ample cause to carefully consider the tradeoffs not only must they be spread almost neurotically throughout frameworkthey may also break tools you rely on example impacts of slotslisttree and mapattrs as more realistic example of slotseffectsdue to the first bullet in the prior section' listtree class does not fail when mixed in to class that defines __slots__even though it scans instance namespace dictionaries the lister class' own lack of slots is enough to ensure that the instance will still have __dict__and hence not trigger an exception when fetched or indexed for exampleboth of the following display without error--the second also allows names not in the slots list to be assigned as instances attributesincluding any required by the superclassclass (listtree)pass (okno __slots__ used new-style class extensions