The attribute __dict__
must contain user-defined attributes.
, __dict__
. , , .
, . . __getattribute__
, object
; type(object).__getattribute__(attribute_name)
, , , ( __dict__
).
__bases__
, type()
; :
>>> class Foo:
... pass
...
>>> Foo.__bases__
(<class 'object'>,)
>>> type.__dict__['__bases__']
<attribute '__bases__' of 'type' objects>
>>> type.__dict__['__bases__'].__get__(Foo, type)
(<class 'object'>,)
__dict__
, . , , (__module__
__doc__
), , (__dict__
__weakref__
). , , type
, .
, __bases__
, __doc__
? __bases__
, . Python , , (, ).