10:48:46paulapatienceActually, pybind11 has the keep_alive policy: https://pybind11.readthedocs.io/en/stable/advanced/functions.html#keep-alive
10:49:14paulapatienceIt says it's useful for example when adding an item to a container. You can say that the item added needs to be kept alive while the container is alive.
10:50:08paulapatienceThat seems like it would be a good idea to have
10:53:08paulapatienceI think that's how they solve the very problem I described above.
10:57:48paulapatienceThey also have return_value_policy::reference_internal, which is essentially keep_alive<0,1>, which prevents the parent object from being garbage collected while the returned value is alive; useful for getters
10:58:51paulapatienceYeah, I'm pretty sure this is exatly what I was describing above.
13:18:56bikereproduced the ironclad problem. i'm guessing something's gone wrong with ub32 array constants.