Semen Yesylevskyy
Semen Yesylevskyy
Correct me if I'm wrong (I don't know internals of pybind11) but it seems that when clone() is called only C++ A_trampoline object is created but not the B instance...
Well, this black magic works :) At least the program now behaves as expected. However I don't quit understand the point with __init__: ``` from module1 import * class B(A):...
Well, it seems that the attributes are not copied and have to be assigned in python-side "copy-constructor": ``` def __init__(self,other=None): if other: A.__init__(self,other) self.x = other.x # Without this x...
Btw, both copy() and deepcopy() fails on B: ``` inst = B() copy.deepcopy(inst) > Traceback (most recent call last): File "test_1.py", line 21, in copy.deepcopy(inst) File "/usr/lib/python2.7/copy.py", line 190, in...
Wow! That is indeed much more involved that I thought. Thank you very much, @dean0x7d ! Probably it worth adding this example somewhere to documentation?