-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-120097: Make FrameLocalsProxy a mapping #120101
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-120097: Make FrameLocalsProxy a mapping #120101
Conversation
@@ -420,6 +421,17 @@ def test_unsupport(self): | |||
with self.assertRaises(TypeError): | |||
copy.deepcopy(d) | |||
|
|||
def test_is_mapping(self): | |||
x = 1 |
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.
Why do you need x
? To fill f_locals
? In this case I propose to use a inner function. Or maybe two: with and without locals.
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.
The contents are irrelevant, but we want something just to make sure we are testing the right thing.
Without x = 1
, the locals would just be {}
and it would be too easy to mistakenly test the wrong mapping.
Co-authored-by: Nikita Sobolev <[email protected]>
Is the test failure related? |
Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping * Allow FrameLocalsProxy to matching mapping patterns (cherry picked from commit d1c673b) Co-authored-by: Mark Shannon <[email protected]>
GH-120749 is a backport of this pull request to the 3.13 branch. |
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping * Allow FrameLocalsProxy to matching mapping patterns
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping * Allow FrameLocalsProxy to matching mapping patterns
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping * Allow FrameLocalsProxy to matching mapping patterns
) Co-authored-by: Alyssa Coghlan <[email protected]>
|
Uh oh!
There was an error while loading. Please reload this page.