Replies: 4 comments 7 replies
|
|
|
We also don't support subinterpreters, so we don't have to deal with it. |
|
Hi, right, IIRC |
|
Basically, if the interpreter is already shut down, you won't get silent memory corruption or dangling references — PyO3 will either panic (if you try to bind it) or safely no-op on Drop. You can't read anything inside Py directly anyway. You need to bind it first (.bind(py) or Python::with_gil(...)). If CPython is dead, getting the GIL/token will panic, so you never get a chance to dereference a dangling pointer. |
Uh oh!
There was an error while loading. Please reload this page.
Hi all! I'm learning how to use pyo3 allowing to use python from rust mainly.
I got a lot of things but I'm still confused with
Py<T>... this one does not have any lifetime, all classes must be initialized in a python instance which is where exists its memory, so why is notPy<'inst, T>? we could stop all the python interpreters andPy<T>could be a dangling reference, or I'm confused?Thx!
All reactions