-
Notifications
You must be signed in to change notification settings - Fork 825
split PyFunctionArgument
to specialize Option
#5002
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
Conversation
Adds const generic parameter to `PyFunctionArgument` to allow specialization. This allows `Option` wrapped extraction of some types that can't implement `FromPyObject(Bound)` because they require a `holder` to borrow from, most notably `&T` for `T: PyClass`. Closes PyO3#4965
} | ||
|
||
impl TypeExt for syn::Type { | ||
fn elide_lifetimes(mut self) -> Self { |
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 guess we should add a FIXME somewhere here, and say that we want to remove this again.
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'm happy to leave it as-is, we can see how brittle it is in practice (or maybe we end up removing this again when it's unused).
Oops forgot to click merge 🤦 |
Adds const generic parameter to
PyFunctionArgument
to allow specialization. This allowsOption
wrapped extraction of some types that can't implementFromPyObject(Bound)
because they require aholder
to borrow from, most notably&T
forT: PyClass
.Option
, innerOption
s will use theFromPyObject
implToDo:
Closes #4965