-
Notifications
You must be signed in to change notification settings - Fork 901
move away from the FromPyObject blanket for PyClass + Clone
#5488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move away from the FromPyObject blanket for PyClass + Clone
#5488
Conversation
8cc541d to
074b324
Compare
|
This approach looks good to me, thanks. Documentation with the rest of the |
0476533 to
f5c3be0
Compare
|
Thanks for the feedback! I've added the newsfragment, extended the pyclass option table and added a paragraph in the guide. Should we also mention this in the migration guide already, are do we wait until we emit a warning? |
73830a8 to
6b9ad95
Compare
6b9ad95 to
568f4ee
Compare
davidhewitt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks!
I think no need for this to go in the migration guide until we begin emitting the warning. Users don't need to do anything with this to upgrade to 0.27.
This proposes a first step in removing the
FromPyObjectblanket implementation for cloneable pyclasses.This adds a marker trait
ExtractPyClassWithClonewhich is automatically implemented by the#[pyclass]macro for every pyclass and modifies the blanket to require the marker. I think this should be functionally equivalent. It also adds a newskip_from_py_objectoption to opt out of emitting the marker trait and thus enable a customFromPyObjectimplementation.The following steps could then be:
FromPyObjectimpl directly)Ref #5419