I have a program for which it would be most sensible to overwrite an object in memory instead of changing it, or redirecting a reference to it.
Basically, if I was writing C++, I would have multiple pointers all referring to the same address in memory. I would like to overwrite the contents at that address.
I would like to be able to do this from within the object itself as well.
i.e.
class MyClass
def __init__(self):
pass
def overwrite(self,otherObjectOfTypeMyClass):
#after this operation, all references to self now point to otherObjectOfTypeMyClass