I want to create a copy of an object from out of its base class:
class A(object):
def copy(self):
....
class B(A):
....
b = B()
b.copy()
I'm not sure how to do this:
def copy(self):
cpy = self.__new__(self.__class__)
return cpy
seems not to call the constructor __init__().
How is such a thing done correctly? Where is the exact difference between
__new__ and __init__?
Thanks
Uwe