-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-125420: implement Sequence.__reversed__
API on memoryview
objects
#125505
base: main
Are you sure you want to change the base?
gh-125420: implement Sequence.__reversed__
API on memoryview
objects
#125505
Conversation
picnixz
commented
Oct 15, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: memoryview is a Sequence but does not implement the full Sequence API #125420
a95b097
to
4485dea
Compare
Since this adds significant complexity and |
I won't have the bandwidth to report the timings but I'll do it tomorrow. I won't be reachable until next Tuesday, so feel free to ignore this PR for now (we can always consider it later). |
There's some time left until the 3.14 feature freeze :) |
Some update: materializing the reversed iterator is now slower since precomputing the format is needed and other stuff is happening behind the scenes but consuming the iterator is faster once the number of items exceeds 32 (release non PGO). For smaller views, it's more or less the same speed (the call
|
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.
Sorry for the long review--a lot of these are formatting changes, but there are a few things that certainly need to get fixed.
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 did a bit of stress testing locally, and despite my best efforts, I was unable to get this to break 😉. LGTM, thank you!