How can I dynamically insert a base class in a given class
gdamjan at gmail.com
Sun May 10 05:04:17 CEST 2009
How can I dynamically insert a base class in a given class? Yeah, I'm
writing a class decorator that needs to manipulate the class by
inserting another base class in it.
return 'really really'
I've come up with this ... but I'm sure it has some shortcomings
# do stuff with args and cls
return type(cls.__name__, cls.__bases__ + (ReallyBase,),
дамјан ( http://softver.org.mk/damjan/ )
war is peace
freedom is slavery
restrictions are enablement
More information about the Python-list