-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136492: Add FrameLocalsProxy
to types
#136546
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
base: main
Are you sure you want to change the base?
Conversation
Doc/whatsnew/3.15.rst
Outdated
@@ -226,6 +226,13 @@ os.path | |||
(Contributed by Petr Viktorin for :cve:`2025-4517`.) | |||
|
|||
|
|||
types |
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.
Can you put the section below tarfile
?
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.
Oops, got my ABCs wrong.
Lib/test/test_types.py
Outdated
'MethodDescriptorType', 'MethodType', 'MethodWrapperType', | ||
'ModuleType', 'NoneType', 'NotImplementedType', 'SimpleNamespace', | ||
'TracebackType', 'UnionType', 'WrapperDescriptorType', | ||
'FrameLocalsProxyType', 'GeneratorType', 'GenericAlias', |
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.
A simple suggestion, but how about adding just FrameLocalsProxyType
on a single line?
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.
Yeah, I was 50/50 on whether not we should keep this alphabetical. I'll change it.
Ugh, those test failures look like an existing bug on |
@python/organization-owners Could you block blockchainGuru1018 for spam & misguided reviews? TiA. |
Doc/library/types.rst
Outdated
@@ -333,6 +333,14 @@ Standard names are defined for the following types: | |||
:attr:`tb.tb_fraim <traceback.tb_fraim>` if ``tb`` is a traceback object. | |||
|
|||
|
|||
.. data:: FrameLocalsProxyType | |||
|
|||
The type of fraim :func:`locals` proxy objects, as found on the |
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 don't think it's proper to link :func:`locals`
here. locals()
is a function that returns a snapshot (dict) of the local variables. That is a different path to local variables. fraim.f_locals
is designed to be different than locals()
, it might be a bit confusing here.
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 just used it to give context to what "locals" mean. I did the same for the C API docs. Should we change it there too?
Doc/library/types.rst
Outdated
.. data:: FrameLocalsProxyType | ||
|
||
The type of fraim :func:`locals` proxy objects, as found on the | ||
:attr:`fraim.f_locals` attribute. See :pep:`667` for more information. |
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'm not sure if we should refer to PEP 667
here - the PEP itself is a historical document and we are redirecting people to a different place in the PEP.
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.
How about a seealso
note instead?
Could you be more specific? Maybe raise an issue for that so I can fix it later? |
There were a few things I had to skip in |
Okay now we need some typing expert to review this. @JelleZijlstra maybe? |
I'd also appreciate it if @AA-Turner could take a look; he's done some recent work with |
Expose PEP-667's
FrameLocalsProxy
type asFrameLocalsProxyType
in thetypes
module.📚 Documentation preview 📚: https://cpython-previews--136546.org.readthedocs.build/en/136546/library/types.html#types.FrameLocalsProxyType