-
Notifications
You must be signed in to change notification settings - Fork 806
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
migrate IntoPyCallbackOutput
to use IntoPyObject
#4607
Conversation
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.
Thanks!
newsfragments/4607.changed.md
Outdated
- `IntoPyCallbackOutput` switched blanket implementation to `IntoPyObject` | ||
- `IntoPyCallbackOutput` gained `'py` lifetime parameter |
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.
IntoPyCallbackOutput
is hidden, so I don't think this needs a changelog..unless it enables users to do things they couldn't do before (does it?). In which case we should document that instead.
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.
Oh, I didn't notice that the whole module was hidden (maybe it should be moved into impl_
). This should not enable any new things. The trait is used however as a public bound in PyModuleMethods::add_wrapped
and PyCFunction
constructors. Because the blanket impl changed there could be breakage for downstream types that do not (yet) implement IntoPyObject
. The additional lifetime is less of a concern in this case I guess.
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.
I think I'd suggest the following:
- Just skip the CHANGELOG from this PR
- Two follow ups (ideally to complete before 0.23), let's open them as issues:
- Let's move
pyo3::callback
module into theimpl_
submodule - Let's move the function constructors to a new trait. They don't need all the generic complexity of
IntoPyCallbackOutput
, it would be probably good enough to have a simple trait which is implemented for bothT: IntoPyObject
andResult<T, E> where T: IntoPyObject, E: Into<PyErr>
- Let's move
newsfragments/4607.changed.md
Outdated
- `IntoPyCallbackOutput` switched blanket implementation to `IntoPyObject` | ||
- `IntoPyCallbackOutput` gained `'py` lifetime parameter |
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.
I think I'd suggest the following:
- Just skip the CHANGELOG from this PR
- Two follow ups (ideally to complete before 0.23), let's open them as issues:
- Let's move
pyo3::callback
module into theimpl_
submodule - Let's move the function constructors to a new trait. They don't need all the generic complexity of
IntoPyCallbackOutput
, it would be probably good enough to have a simple trait which is implemented for bothT: IntoPyObject
andResult<T, E> where T: IntoPyObject, E: Into<PyErr>
- Let's move
1014423
to
73ec2dc
Compare
This migrates
IntoPyCallbackOutput
blanket to useIntoPyObject
.