标签:tle order actual limit blog app sequence eth log
参考:http://www.cnblogs.com/blackmatrix/p/5630515.html
官方:https://docs.python.org/2/tutorial/classes.html
Python supports a limited form of multiple inheritance as well. A class definition with multiple base classes looks like this:
For old-style classes, the only rule is depth-first, left-to-right. Thus, if an attribute is not found in DerivedClassName, it is searched in Base1, then (recursively) in the base classes of Base1, and only if it is not found there, it is searched in Base2, and so on.
(To some people breadth first — searching Base2 and Base3 before the base classes of Base1 — looks more natural. However, this would require you to know whether a particular attribute of Base1 is actually defined in Base1 or in one of its base classes before you can figure out the consequences of a name conflict with an attribute of Base2. The depth-first rule makes no differences between direct and inherited attributes of Base1.)
For new-style classes, the method resolution order changes dynamically to support cooperative calls to super(). This approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages.
以上.
标签:tle order actual limit blog app sequence eth log
原文地址:http://www.cnblogs.com/tiantiandas/p/python_class_inherit_order.html