masklinn í dag viðrar vel til loftárása | Code :
def superTree(cls, level=0): print "%s%s"%(" "*level, cls.__name__) for c in cls.__bases__: superTree(c, level+1)
|
Demo:
Code :
>>> class Foo(object): pass >>> class Bar(list): pass >>> class Baz(object): pass >>> class Buzz(Foo, Bar, Baz): pass >>> class Foobar(Buzz, dict): pass >>> class Bizz(object): pass >>> class Foobar(Buzz, Bizz): pass >>> superTree(Foobar) Foobar Buzz Foo object Bar list object Baz object Bizz object
|
---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
|