Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-142349: Implement PEP 810#142351
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?
gh-142349: Implement PEP 810 #142351
Conversation
pablogsal commented Dec 6, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
…s on bad usage of lazy
Highlight lazy imports in the new REPL
Lazy review updates
markshannon commented Jan 28, 2026
@DinoV Also, I'm bit concerned that with sufficient ingenuity, other cases will be found that expose lazy import objects. Although, I haven't found any as yet. |
Flow in _PyInterpreterFrame and fix issue when global not defined
DinoV commented Jan 28, 2026
Nice catch! I've modified this to use a dictionary watcher instead so that we can catch all of the assignments to globals. Arguably this is overkill... we say that we don't absolutely prevent the leak of lazy objects, and specifically call out The nice thing about using the dictionary watcher is it makes other things more full-proof - we don't need to catch the assignments and call the helper to clear the dict keys version. |
DinoV commented Jan 28, 2026
I have made the requested changes; please review again. |
DinoV commented Jan 28, 2026
The JIT already is using But the goal isn't to 100% make sure that no lazy objects leak as mentioned in the PEP. So I think if there was a performance impact from this then we could go back to saying if you leak a lazy object and stick it into globals directly that you may get incorrect behavior. I'll look at getting a perf run against the current branch to make sure the impact is as expected. |
StanFromIreland commented Jan 28, 2026
FYI there was a bad merge. |
📚 Documentation preview 📚: https://cpython-previews--142351.org.readthedocs.build/