-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Provide curframe_locals for backward compatibility but deprecate it #125951
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
Conversation
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.
Couple of suggestions inline for the exact deprecation warning wording, but I think we do need to mention this in NEWS and the What's New docs:
- It's a backwards compatibility fix relative to 3.13.0 and 3.14.0a1 (hence NEWS)
- It's a new deprecation warning relative to 3.12.x (hence inclusion in the What's New deprecation listings)
Co-authored-by: Alyssa Coghlan <[email protected]>
@ncoghlan I gave myself some vacation from CPython a few weeks ago. Now I'm picking up the unfinished stuff. I added the news to explain the deprecation. |
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <[email protected]>
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <[email protected]>
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <[email protected]> Closes: #39746 Signed-off-by: Sam James <[email protected]>
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.
Suggested wording adjustment for the What's New, but otherwise LGTM!
Doc/whatsnew/3.14.rst
Outdated
The undocumented ``pdb.Pdb.curframe_locals`` is deprecated because with | ||
PEP 667 we don't need to cache the locals anymore. Derived debuggers | ||
should access ``pdb.Pdb.curframe.f_locals`` directly. |
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 undocumented ``pdb.Pdb.curframe_locals`` is deprecated because with | |
PEP 667 we don't need to cache the locals anymore. Derived debuggers | |
should access ``pdb.Pdb.curframe.f_locals`` directly. | |
The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a deprecated read-only property | |
accessing ``pdb.Pdb.curframe.f_locals``. The low overhead dynamic frame locals access added in | |
Python 3.13 by PEP 667 means the frame locals cache reference previously stored in this attribute | |
is no longer needed. Derived debuggers should access ``pdb.Pdb.curframe.f_locals`` directly in | |
Python 3.13 and later versions. |
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.
Is this correct? Line 617 does not read like a correct sentence.
We removed
pdb.Pdb.curframe_locals
in #124369, but there are 3rd party libraries depending on it. We add it back but give a deprecation warning so we can really remove it in the future.