trelau / pyOCCT_binder

Binding generator for pyOCCT project
GNU Lesser General Public License v2.1
7 stars 1 forks source link

Add ability to set keep_alive #23

Closed frmdstryr closed 3 years ago

frmdstryr commented 3 years ago

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:

trelau commented 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.

frmdstryr commented 3 years ago

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?

trelau commented 3 years ago

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.