diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-21 11:35:26 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-21 11:35:26 (GMT) |
| commit | db64dae74517d094da5516b9c96d3e81e7108ebf (patch) | |
| tree | 69f96c4cbba70878762f070613f40877e3fadf1f /Lib | |
| parent | f7303cd96742cf6ae3dedc4e3d5211140922186f (diff) | |
| download | cpython-db64dae74517d094da5516b9c96d3e81e7108ebf.zip cpython-db64dae74517d094da5516b9c96d3e81e7108ebf.tar.gz cpython-db64dae74517d094da5516b9c96d3e81e7108ebf.tar.bz2 | |
[3.13] gh-74929: PEP 667 general docs update (gh-119291)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
(cherry picked from commit e870c852c0ea96fa4e4569e9c39c7ceb80ce858d)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/code.py | 8 | ||||
| -rwxr-xr-x | Lib/pdb.py | 9 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Lib/code.py b/Lib/code.py index 9d12456..0c2fd29 100644 --- a/Lib/code.py +++ b/Lib/code.py @@ -25,10 +25,10 @@ class InteractiveInterpreter: def __init__(self, locals=None): """Constructor. - The optional 'locals' argument specifies the dictionary in - which code will be executed; it defaults to a newly created - dictionary with key "__name__" set to "__console__" and key - "__doc__" set to None. + The optional 'locals' argument specifies a mapping to use as the + namespace in which code will be executed; it defaults to a newly + created dictionary with key "__name__" set to "__console__" and + key "__doc__" set to None. """ if locals is None: @@ -392,9 +392,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): self.tb_lineno[tb.tb_frame] = lineno tb = tb.tb_next self.curframe = self.stack[self.curindex][0] - # The f_locals dictionary is updated from the actual frame - # locals whenever the .f_locals accessor is called, so we - # cache it here to ensure that modifications are not overwritten. + # The f_locals dictionary used to be updated from the actual frame + # locals whenever the .f_locals accessor was called, so it was + # cached here to ensure that modifications were not overwritten. While + # the caching is no longer required now that f_locals is a direct proxy + # on optimized frames, it's also harmless, so the code structure has + # been left unchanged. self.curframe_locals = self.curframe.f_locals self.set_convenience_variable(self.curframe, '_frame', self.curframe) |
