You work directly on classes. object.__getattribute__used only for instances Aand B. This is because special methods are looked up by type ; for instances, type is a class.
For classes then type: .. type:
>>> class A:
... f = 1
...
>>> class B(A):
... pass
...
>>> type(B)
<class 'type'>
used by type.__getattribute__:
>>> type.__getattribute__(B, 'f')
1
object.__getattribute__ :
>>> object.__getattribute__(B(), 'f')
1
( ), , , , MRO. object.__getattribute__. , object.__getattribute__ (, self, ) type(self).__mro__.
; type.__getattribute__ self.__mro__ ; self .
object.__getattribute__ , f B , f type(B).__mro__. type.__getattribute__, A B.__mro__, f :
>>> type(B).__mro__
(<class 'type'>, <class 'object'>)
>>> B.__mro__
(<class '__main__.B'>, <class '__main__.A'>, <class 'object'>)