-
Notifications
You must be signed in to change notification settings - Fork 782
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
add second lifetime to PyRef
and PyRefMut
#4720
base: main
Are you sure you want to change the base?
Conversation
8ad5fcd
to
04fadee
Compare
Co-authored-by: David Hewitt <[email protected]>
Thank you for making progress on this one. There's a measurable perf boost in the ordering operator benchmarks and I guess similarly this is a win for most Again the same thing that's paining me as in #4390 is I'm trying to think hard how we keep the API easy for users. Lifetimes scare Rust newbies enough, let alone two 😂 Are there any tricks we can play which avoid the complexity for the common case? Here's two I can think of:
(Given that we're wanting to revisit pyclass borrow checking and locking anyway, maybe we could add new types Opinions welcome to which, if any, of these ideas are not crazy 😂 |
Thanks for your thoughts!
That's certainly true. I agree that introducing The second option sounds very interesting. Switching the lifetime and introducing it via |
Companion to #4390