mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-103737: IDLE - Remove unneeded .keys() for dict iteration (#110960)
Add comments where .keys() is needed. Leave debugger usages along because situation is unclear as indicated in expanded comment. Most testing is manual.
This commit is contained in:
parent
77dbd95609
commit
baefbb21d9
8 changed files with 28 additions and 26 deletions
|
|
@ -747,10 +747,11 @@ def showtraceback(self):
|
|||
self.tkconsole.open_stack_viewer()
|
||||
|
||||
def checklinecache(self):
|
||||
c = linecache.cache
|
||||
for key in list(c.keys()):
|
||||
"Remove keys other than '<pyshell#n>'."
|
||||
cache = linecache.cache
|
||||
for key in list(cache): # Iterate list because mutate cache.
|
||||
if key[:1] + key[-1:] != "<>":
|
||||
del c[key]
|
||||
del cache[key]
|
||||
|
||||
def runcommand(self, code):
|
||||
"Run the code without invoking the debugger"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue