I'm trying to get reflection to work in Python. I'm used to it in java but am having trouble getting it to work in python. Here is basically the code I have.
c = myObject.__class__ # get the class of the object
newC = c.__new__(c) #create a new instance of c
This doesn't work however. http://www.network-theory.co.uk/docs/pylang/Basiccustomization.html It says that __new__ makes a new instance but the error I'm getting is:
Exception in thread "Thread-4" Traceback (innermost last):
File "<string>", line 1, in ?
TypeError: class.__new__(X): X is not a type object (class)