does not include to be clearthis is major incompatibility with the traditional class model--one that can complicate any code that accesses attributes genericallyand may even cause some programs to fail altogether for instanceprograms that list or access instance attributes by name string may need to use more storage-neutral interfaces than __dict__ if slots may be used because an instance' data may include class-level names such as slots--either in addition to or instead of namespace dictionary storage--both attribute sources may need to be queried for completeness let' see what this means in terms of codeand explore more about slots along the way first offwhen slots are usedinstances do not normally have an attribute dictionary --insteadpython uses the class descriptors feature introduced ahead to allocate and manage space reserved for slot attributes in the instance in python xand in for new-style classes derived from objectclass c__slots__ [' '' 'requires "(object)in only __slots__ means no __dict__ by default ( __dict__ attributeerror'cobject has no attribute '__dict__howeverwe can still fetch and set slot-based attributes by name string using storageneutral tools such as getattr and setattr (which look beyond the instance __dict__ and thus include class-level names like slotsand dir (which collects all inherited names throughout class tree)getattr( ' ' setattr( ' ' 'ain dir(xtrue 'bin dir(xtrue but getattr(and setattr(still work and dir(finds slot attributes too also keep in mind that without an attribute namespace dictionaryit' not possible to assign new names to instances that are not names in the slots listclass d__slots__ [' '' 'def __init__(self)self use (objectfor same result in cannot add new names if no __dict__ (attributeerror'dobject has no attribute ' advanced class topics