-
Notifications
You must be signed in to change notification settings - Fork 763
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
Py::as_ref and Py::into_ref (remove AsPyRef) #1098
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.
Nice 💯
I'm confused by |
Great feedback. We've seen in rare cases APIs want to return a reference but have a I'll rework documentation later based on the comments here. |
Ah, good point. I did not realize that |
Yep - the returned reference for (It cannot outlive |
afcc149
to
22edfff
Compare
Thanks for the feedback; I've pushed the suggested improvements to the docs. |
Co-authored-by: Georg Brandl <[email protected]>
22edfff
to
6b3c6fd
Compare
I introduce
Py::as_ref
andPy::into_ref
. We spoke aboutPy::into_ref
in #1041.I moved
AsPyRef::as_ref
toPy::as_ref
because I think it's easier to document and for users to discover. Also means one more trait can be removed!Closes #1041