Problem description
The title is by @Yhg1s, I'm just the messenger here.
We happened to stumble over this in connection with pybind11, then I looked in nanobind and see that's also adding capsules to builtins:
|
int rv = PyDict_SetItemString(PyEval_GetBuiltins(), NB_INTERNALS_ID, capsule); |
Thomas wrote:
- pybind11 should use a separate module for this instead.
- messing with builtins is going to have some undesireable performance effects in the future.
- If you want per-interpreter state that's easily accessible, just stuff a container object into sys.modules.
Reproducible example code
No response