Replies: 1 comment 1 reply
-
Great question and sorry for the slow reply. As I guess you're aware, the async interaction here adds a lot of complexity because the GIL can't be held across the As such, I think In PyO3 0.23 we will be completing the removal of the Python::with_gil(|py| Ok(PyBytes::new(py, &data).unbind())) which I think is even more fine :) |
Beta Was this translation helpful? Give feedback.
-
Hi folks! With @davidhewitt's fantastic effort to get a pyo3_asyncio_0_21 fork rolling, we've upgraded to the new Bound API. This was all smooth sailing, but we have one pattern that looks a bit funny:
Old code:
New code:
Note how we now do
PyBytes::new_bound(py, &data).unbind()
- we first bind, but then we immediately unbind again. That feels wrong somehow. Are we holding things wrong, is there a better/more correct way?Beta Was this translation helpful? Give feedback.
All reactions