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 identical to A, yet have a different i: id(A) != id(B)
Watch out, i am not talking about instances but classes to be cloned.
I have a class A and i want a class B with exactly the
Share
I’m pretty sure whatever you are trying to do can be solved in a better way, but here is something that gives you a clone of the class with a new id:
gives: