Re:Interfacing Python and C: Advanced “ctypes” Features
by fafhrd91 on Tuesday November 07, 2017 @11:46AM
(#15644932)
Pyo3 support both. You can expose rust to python, and would look to python as native functions and classes or you can call python code from rust
Pyo3 uses rust refs ownership to enforce proper Gil usage. You code won’t compile if you use Gil in wrong way
Unless the PyO3 documentation is completely leaving out a major application, it doesn't support this scenario.