Skip to content
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

Implement AsPyPointer for Borrowed #4868

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakelishman
Copy link
Contributor

This is already available in theory as the as_ptr method, but implementing the trait allows it to be used in a generic way.

I briefly rubbed against this trying to do a obj.is(other) where other was borrowed.

This is already available in theory as the `as_ptr` method, but
implementing the trait allows it to be used in a generic way.
@Icxolu
Copy link
Contributor

Icxolu commented Jan 23, 2025

Just as a cross-reference, I believe there are plans to remove AsPyPointer entirely, see #3429. Not sure if we should add additional impls because of that. Maybe it's fine, but probably something to consider here.

@jakelishman
Copy link
Contributor Author

No worries from my side - I guess the more accurate version of my feature request is "have Borrowed work with PyAnyMethods::is". At the moment, that bound is AsPyPointer, but I'm happy to pivot this to whatever the replacement is meant to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants