summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_debugobj.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2023-10-18 08:14:52 (GMT)
committerGitHub <noreply@github.com>2023-10-18 08:14:52 (GMT)
commitbaefbb21d91db2d950706737a6ebee9b2eff5c2d (patch)
treeb667e758572b247d244afddd11fcdcb4d3466106 /Lib/idlelib/idle_test/test_debugobj.py
parent77dbd956090aac66e264d9d640f6adb6b0930b87 (diff)
downloadcpython-baefbb21d91db2d950706737a6ebee9b2eff5c2d.zip
cpython-baefbb21d91db2d950706737a6ebee9b2eff5c2d.tar.gz
cpython-baefbb21d91db2d950706737a6ebee9b2eff5c2d.tar.bz2
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.
Diffstat (limited to 'Lib/idlelib/idle_test/test_debugobj.py')
-rw-r--r--Lib/idlelib/idle_test/test_debugobj.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/idlelib/idle_test/test_debugobj.py b/Lib/idlelib/idle_test/test_debugobj.py
index 131ce22..90ace4e 100644
--- a/Lib/idlelib/idle_test/test_debugobj.py
+++ b/Lib/idlelib/idle_test/test_debugobj.py
@@ -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__':