Skip to content
Discussion options

You must be logged in to vote

It needs to be Py<PyAny>. This section of the guide may be helpful to understand the difference.

In short: &'py PyAny is only valid to use as long as you hold the Python Interpreter Lock (GIL). Therefore it is not safe to put into a pyclass, which can live indefinitely as a Python object. Py<PyAny> requires a Python GIL token to access and is therefore safe to share around.

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@birkenfeld
Comment options

@shenjackyuanjie
Comment options

@shenjackyuanjie
Comment options

@birkenfeld
Comment options

@shenjackyuanjie
Comment options

Answer selected by shenjackyuanjie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants