Uh oh!
There was an error while loading. Please reload this page.
gh-119053: Implement the fast path for list.__getitem__ - #119112
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
This looks good to me. I noticed that we perform a validity check on the index several times now:
- In list_item
- In list_get_item_ref
- In list_item_impl (if we end up taking the slow path)
While this doesn't affect correctness, I think it would make sense to refactor the code to eliminate the redundant checks given how performance sensitive this code is. That could be tackled in a separate PR, though.
Uh oh!
There was an error while loading. Please reload this page.
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…gh-119112) (cherry picked from commit ab4263a) Co-authored-by: Donghee Na <donghee.na@python.org>
GH-119309 is a backport of this pull request to the 3.13 branch. |
list.__getitem__#119053