You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the trait_bounds example, the trait signature impl Model for UserModel has no way to pass a Python into the trait methods. The idea for this example is to show how to wrap a Rust trait which doesn't know anything about Python, so I don't think changing the trait definition is a solution either.
It would be nice to come up with a pattern here which allows #[pyclass] structs which work like in this example to implement Rust traits without needing to acquire GIL.
The trait doesn't even have to be a complicated one like in the trait_bounds example. For some #[pyclass] structs even their Display implementation may need to acquire the GIL.
The text was updated successfully, but these errors were encountered:
Originally posted by @davidhewitt in #1037
It would be nice to come up with a pattern here which allows
#[pyclass]
structs which work like in this example to implement Rust traits without needing to acquire GIL.The trait doesn't even have to be a complicated one like in the
trait_bounds
example. For some#[pyclass]
structs even theirDisplay
implementation may need to acquire the GIL.The text was updated successfully, but these errors were encountered: