November 1998
Beginner
80 pages
1h 14m
English
Some objects export special attributes which are predefined by Python.
X.__dict__Dictionary used to store object X’s writeable attributes.
I.__methods__List of instance object I’s methods (name strings); available on many built-in types.
I.__members__List of instance object I’s data attributes (name strings); available on many built-in types.
I.__class__Class object from which instance I was generated.
C.__bases__Tuple of class C’s base classes, as listed in C’s class statement header.
X.__name__Object X’s name as a string; for classes, the name in the statement header; for modules, this name as used in imports (“__main__” if the module is run as a top-level program).
Read now
Unlock full access