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
Due to issues making delay reference count increments sound, they were removed #4095 and replaced by an Clone implementation for Py which will panic without the GIL being held, gated by the py-clone feature.
This has several usability downsides, e.g. #[pyo3(get)] stops working with Py<T> fields which however is a very important use case when sharing data with Python code. Similarly, the PyBacked* types cannot be unconditionally Clone themselves.
Both problems (and likely others) should be resolvable if we add a trait, e.g. CloneRef or PyClone with signature
fnclone_ref(&self,py:Python<'_>) -> Self;
and implement it unconditionally for Py<T> and add a blanket impl based on Clone. The proc macro machinery behind #[pyo3(get)] could then go via this trait instead of the plain Clone.
The text was updated successfully, but these errors were encountered:
Due to issues making delay reference count increments sound, they were removed #4095 and replaced by an
Clone
implementation forPy
which will panic without the GIL being held, gated by thepy-clone
feature.This has several usability downsides, e.g.
#[pyo3(get)]
stops working withPy<T>
fields which however is a very important use case when sharing data with Python code. Similarly, thePyBacked*
types cannot be unconditionallyClone
themselves.Both problems (and likely others) should be resolvable if we add a trait, e.g.
CloneRef
orPyClone
with signatureand implement it unconditionally for
Py<T>
and add a blanket impl based onClone
. The proc macro machinery behind#[pyo3(get)]
could then go via this trait instead of the plainClone
.The text was updated successfully, but these errors were encountered: