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
Since #3287#[new] is now able to return Py<T> to return an existing Python object (e.g. for singleton classes).
In pure-python code I believe the return value of __new__ is not restricted at all, so it may be elegant in PyO3 if similarly any T: IntoPy<PyObject> could be returned from #[new]. This should be possible as a pure addition without backwards-compatibility concerns.
The text was updated successfully, but these errors were encountered:
Since #3287
#[new]
is now able to returnPy<T>
to return an existing Python object (e.g. for singleton classes).In pure-python code I believe the return value of
__new__
is not restricted at all, so it may be elegant in PyO3 if similarly anyT: IntoPy<PyObject>
could be returned from#[new]
. This should be possible as a pure addition without backwards-compatibility concerns.The text was updated successfully, but these errors were encountered: