summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/browser.py
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2019-06-01 21:03:22 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2019-06-01 21:03:22 (GMT)
commit1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f (patch)
tree3bece5e0602e9ccc5d1c66a9d0e364f572cea1b6 /Lib/idlelib/browser.py
parente5f6207ba6cb510d9370519ba869296be01787be (diff)
downloadcpython-1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f.zip
cpython-1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f.tar.gz
cpython-1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f.tar.bz2
bpo-32411: IDLE: Remove line number sort in browser.py (#5011)
Insertion in line order makes sorting keys by line order unneeded.
Diffstat (limited to 'Lib/idlelib/browser.py')
-rw-r--r--Lib/idlelib/browser.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/idlelib/browser.py b/Lib/idlelib/browser.py
index 234883f..e5b0bc5 100644
--- a/Lib/idlelib/browser.py
+++ b/Lib/idlelib/browser.py
@@ -29,9 +29,10 @@ def transform_children(child_dict, modname=None):
The dictionary maps names to pyclbr information objects.
Filter out imported objects.
Augment class names with bases.
- Sort objects by line number.
+ The insertion order of the dictonary is assumed to have been in line
+ number order, so sorting is not necessary.
- The current tree only calls this once per child_dic as it saves
+ The current tree only calls this once per child_dict as it saves
TreeItems once created. A future tree and tests might violate this,
so a check prevents multiple in-place augmentations.
"""
@@ -51,7 +52,7 @@ def transform_children(child_dict, modname=None):
supers.append(sname)
obj.name += '({})'.format(', '.join(supers))
obs.append(obj)
- return sorted(obs, key=lambda o: o.lineno)
+ return obs
class ModuleBrowser: