Hi.
I can't overcome the following SWIG Python wrapper error:
TypeError: object.__new__(SwigPyObject) is not safe, use SwigPyObject.__new__()

I have the following class hierarchy:
SequenceListener (C++)
 |
V
SceneNodeAction (Python)
 |
V
MoveAction (Python)

I made SceneNodeAction.__deepcopy__ look like this due to the above error:
def __deepcopy__(self, memo):
   cls = self.__class__
   result = cls.__new__(cls)
   memo[id(self)] = result
   result.node = self.node
   result.sequence = mjin2.Sequence(self.sequence)
   return result

Then I tried the 'normal' __deepcopy__ (from http://stackoverflow.com/a/15774013 ) for MoveAction:
def __deepcopy__(self, memo):
   cls = self.__class__
   result = cls.__new__(cls)
   memo[id(self)] = result
   for k, v in self.__dict__.items():
    print "before", k, v
    setattr(result, k, copy.deepcopy(v, memo))
    print "after ", k, v
   return result

And got the same error. This implies that I need to write custom __deepcopy__ for every SWIG Python wrapped based class which is insane (in C++ I would simply reuse copy-constructor).
How can I make generic __deepcopy__ that will work for all SWIG Python wrapped based classes?
Thanks.