The __dict__ object holds the attributes of the instance. The only attribute of your instance is __conf__ , since it is the only one set in your __init__() method. dir() returns a list of the names of the "interesting" attributes of an instance, its class, and its parent classes. These include a and b from your Test class and __init__ from your Base class, as well as several other attributes that Python automatically adds.
The class attributes are stored in each __dict__ class, so what dir() does is go through the inheritance hierarchy and collect information from each class.
source share