dynamic inheritance

Kay Schluehr kay.schluehr at gmx.net
Fri Jun 9 02:59:22 EDT 2006


alf wrote:
> is there any way to tell the class the base class during runtime?
>
> a.

Example:

>>> class A(object):pass
>>> class B(A):pass
>>> B.mro()
[<class '__main__.B'>, <class '__main__.A'>, <type 'object'>]

See also Micheles nice article about the semantics of the "mro" (
method resolution order).

http://www.python.org/download/releases/2.3/mro/

Regards,
Kay




More information about the Python-list mailing list