GH-91153: Handle mutating __index__ methods in bytearray item assignment#94891
Merged
brandtbucher merged 6 commits intopython:mainfrom Jul 19, 2022
Merged
GH-91153: Handle mutating __index__ methods in bytearray item assignment#94891brandtbucher merged 6 commits intopython:mainfrom
__index__ methods in bytearray item assignment#94891brandtbucher merged 6 commits intopython:mainfrom
Conversation
JelleZijlstra
approved these changes
Jul 19, 2022
Member
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks!
The change in semantics seems fine; I don't think we provide guarantees on when dunders like __index__ are called.
Contributor
|
Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Contributor
|
Sorry @brandtbucher, I had trouble checking out the |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 19, 2022
…ssignment (pythonGH-94891) (cherry picked from commit f365895) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
GH-95013 is a backport of this pull request to the 3.10 branch. |
Contributor
|
Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
GH-95014 is a backport of this pull request to the 3.11 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 19, 2022
…ssignment (pythonGH-94891) (cherry picked from commit f365895) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This creates a (very slight) change in semantics. Previously, an assignment to an invalid index would raise without calling
__index__. Now, it calls__index__and then raises. I really doubt it's an issue in practice, though.Also, add some missing nearby braces.
__index__with side-effects #91153