How is __mro__ different from other double underscore names?
问题 I stumbled upon this behavior for double underscore name that I don't understand: class A: pass class B: pass class C(A,B): __id__ = 'c' c = C() print(C.__mro__) # print the method resolution order of class C #print(c.__mro__) # AttributeError: 'C' object has no attribute '__mro__' print(C.__id__) # print 'c' print(c.__id__) # print 'c' I know about the name mangling for __name , which doesn't apply for __name__ (more for overloading operator methods). __id__ behaves just like a regular class