2.1.8 Special Attributes
The implementation adds a few special read-only attributes to several
object types, where they are relevant:
-
x.__dict__ is a dictionary of some sort used to store an
object's (writable) attributes;
-
x.__methods__ lists the methods of many built-in object types,
e.g., [].__methods__ yields
['append', 'count', 'index', 'insert', 'remove', 'reverse', 'sort'];
-
x.__members__ lists data attributes;
-
x.__class__ is the class to which a class instance belongs;
-
x.__bases__ is the tuple of base classes of a class object.
guido@python.org