Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Python<'_> type appearing as a parameter means the caller has already acquired the GIL for you. The GIL is held when Python calls into extension modules, and PyO3 doesn't automatically release it (but you can do so yourself).

It's essentially a dummy parameter that serves as proof that the GIL is held. You need to provide it to PyO3 when calling back into the Python runtime, that way the compiler ensures the GIL is still held where required.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: