I'd like to create a class in Python that takes a single argument in the constructor, another Python class. The instance of the Copy class should have all the attributes and methods of the original class, without knowing what they should be beforehand. Here's some code that almost works:
import copyclass A():l = 'a'class Copy():def __init__(self, original_class):self = copy.deepcopy(original_class)print(self.l)c = Copy(A)
print(c.l)
The print statement in the constructor prints 'a', but the final one gives the error AttributeError: Copy instance has no attribute 'l'
.