mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
[3.12] gh-103737: IDLE - Remove unneeded .keys() for dict iteration (GH-110960) (#111026)
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:
parent
577a8fb72b
commit
b8ce5d9c17
8 changed files with 28 additions and 26 deletions
|
@ -37,7 +37,7 @@ class SequenceTreeItemTest(unittest.TestCase):
|
|||
|
||||
def test_keys(self):
|
||||
ti = debugobj.SequenceTreeItem('label', 'abc')
|
||||
self.assertEqual(list(ti.keys()), [0, 1, 2])
|
||||
self.assertEqual(list(ti.keys()), [0, 1, 2]) # keys() is a range.
|
||||
|
||||
|
||||
class DictTreeItemTest(unittest.TestCase):
|
||||
|
@ -50,7 +50,7 @@ class DictTreeItemTest(unittest.TestCase):
|
|||
|
||||
def test_keys(self):
|
||||
ti = debugobj.DictTreeItem('label', {1:1, 0:0, 2:2})
|
||||
self.assertEqual(ti.keys(), [0, 1, 2])
|
||||
self.assertEqual(ti.keys(), [0, 1, 2]) # keys() is a sorted list.
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue