pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

[FEAT] Support "multi-phase initialization" of modules

Open YannickJadoul opened this issue 4 years ago • 2 comments

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? :-)

YannickJadoul avatar Oct 04 '20 23:10 YannickJadoul

See discussion in old PR: https://github.com/pybind/pybind11/pull/1558#issuecomment-704265826

EricCousineau-TRI avatar Oct 06 '20 13:10 EricCousineau-TRI

Multi-phase initialization (PEP 489) is now a prerequisite for supporting the new per-interpreter GIL (PEP 684) introduced in Python 3.12.

pwuertz avatar Oct 25 '23 09:10 pwuertz