I have a class A and i want a class B with exactly the same capabilities. I cannot or do not want to inherit from B, such as doing class B(A):pass Still i want B to be ident
I guess this is not what you wanted but its what the question seems to be asking for...
class Foo(object): def bar(self): return "BAR!" cls = type("Bar", (object,), dict(Foo.__dict__)) print cls x = cls() print x.bar()