[3.11] gh-103737: IDLE - Remove unneeded .keys() for dict iteration (GH-110960) (#111027)

gh-103737: IDLE - Remove unneeded .keys() for dict iteration (GH-110960)

Add comments where .keys() is needed.
Leave debugger usages along because situation is unclear as indicated in expanded comment.
Most testing is manual.
(cherry picked from commit baefbb21d9)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Miss Islington (bot) 2023-10-18 10:40:39 +02:00 committed by GitHub
parent 50d936a125
commit 7c308f4c64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 26 deletions

View file

@ -99,7 +99,7 @@ class VariablesTreeItem(ObjectTreeItem):
def GetSubList(self):
sublist = []
for key in self.object.keys():
for key in self.object.keys(): # self.object not necessarily dict.
try:
value = self.object[key]
except KeyError: