pybind11
pybind11 copied to clipboard
[FEAT] Support "multi-phase initialization" of modules
Apparently, Python >= 3.5 supports "multi-phase initialization", allowing for sub-interpreters to be used: https://docs.python.org/3/c-api/module.html#multi-phase-initialization
Something tells me this might also be relevant to #1558? (@EricCousineau-TRI might be interested?)
Something to try and play around with, if we have time? :-)
See discussion in old PR: https://github.com/pybind/pybind11/pull/1558#issuecomment-704265826
Multi-phase initialization (PEP 489) is now a prerequisite for supporting the new per-interpreter GIL (PEP 684) introduced in Python 3.12.