Message308945
pyclbr does a linear scan of a file and returns a dict, and Class objects have a dict of children. For objects in the file being scanned, insertion order is the same as line number order. idlelib.browser.transform children filters out objects not in the file, changes the .name of some objects in the file, appends to a list, and sorts by line number. (I should have done the sort in place.) For insertion order dicts, the sort does nothing. In 3.7, insertion order is a language guarantee, not just a (current) CPython implementation detail. The sort does not change the order and is therefore no longer needed. We can reduce
return sorted(obs, key=lambda o: o.lineno)
to
return obs
However, I do want to make sure that there is at least one test that will break if there is a bug somewhere. |
|
Date |
User |
Action |
Args |
2017-12-23 02:41:09 | terry.reedy | set | recipients:
+ terry.reedy |
2017-12-23 02:41:09 | terry.reedy | set | messageid: <1513996869.13.0.213398074469.issue32411@psf.upfronthosting.co.za> |
2017-12-23 02:41:08 | terry.reedy | link | issue32411 messages |
2017-12-23 02:41:07 | terry.reedy | create | |
|