You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python 3.13.0b1: exec() does not populate locals() #118888
Add this paragraph to the main PEP 667 description in the 3.13 "What's New?" doc:
The change to the semantics of locals() in optimized scopes also affects the default behaviour of code execution functions that implicitly target locals() if no explicit namespace is provided (such as exec and eval). In previous versions, whether or not the changes could be accessed by calling locals() after the code finished execution was implementation dependent. In CPython specifically, such code would often appear to work as desired, but could sometimes fail in optimized scopes based on other code (including debuggers and code execution tracing tools) potentially resetting the shared snapshot in that scope. Now, the code will always run against an independent snapshot of locals() in optimized scopes, and hence the changes will never be visible in subsequent calls to locals(). To access the changes made in these cases, an explicit namespace reference must now be passed to the relevant function. Alternatively, it may make sense to switch over to using a higher level code execution API that returns the resulting code execution namespace (such as runpy.run_path).
Add this sentence to the porting note:
Code execution functions that implicitly target locals() (such as exec and eval) must be passed an explicit namespace to access their results in an optimized scope.
Activity
ncoghlan commentedon May 30, 2024
Current plan for changes
ncoghlan commentedon May 31, 2024
No PR yet as I'll merge #119379 before making any further PEP 667 related updates.
gh-118888: Further PEP 667 docs updates (gh-119893)
pythongh-118888: Further PEP 667 docs updates (pythongh-119893)
[3.13] gh-118888: Further PEP 667 docs updates (gh-119894)
pythongh-118888: Further PEP 667 docs updates (pythongh-119893)
pythongh-118888: Further PEP 667 docs updates (pythongh-119893)
pythongh-118888: Further PEP 667 docs updates (pythongh-119893)
setup.py: Fix version retrieval on Python 3.13+
Update `setup.py` to accommodate `Python3.13.0`
py-Pillow: add py313 subport
py-Pillow: add py313 subport
py-Pillow: add py313 subport
py-Pillow: add py313 subport
Fix get_version for Python 3.13
Fix get_version for Python 3.13
Fixes __version__ not found error with Python 3.13 (see python/cpytho…
fix locals() writable, does not seem to work on py313
Fixes __version__ not found error with Python 3.13 (see python/cpytho…