Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attribute of SWIG wrapped classes instances were overwritten on __ini…
…t__() When a SWIG classes instances is initialized, its internal dictionary was reset to NULL, which result in the loss of any attribute that might have been set for the instance. Only initialize the internal dictionary on actual PyObject creation. class Test(MySwigWrappedClass): def __init__(self): self.val = "Random Value" MySwigWrappedClass.__init__(self) p = Test() print hasattr(p, "val") # Should return True, but used to return False
- Loading branch information