Closed frmdstryr closed 3 years ago
Looks good. Maybe add a test to cover the basic usage (and any edge cases if you know of any at this point)? If you can do that I think we can merge this now to keep things synced up.
any edge cases if you know of any at this point
The pybind docs say using a reference_internal
return value adds keep_alive
automatically so I'm not sure what happens if both are used. Not sure if it's worth checking for that?
Nah. Probably at this point maybe just a test that reflects a common aspect of pyOCCT to make sure the basic functionality works (and keeps working in the future). As we encounter edge cases in practice we can build up the test suite.
Adds support for https://pybind11.readthedocs.io/en/stable/advanced/functions.html#keep-alive.
Don't need to merge now. This is for smesh. Cherry picked from #21
The pybind arguments are confusing to keep track of so I was thinking of also making it use names?
Eg:
-->0, 1
use-->return_value, this
-->1, 2
use-->this, arg[0]