Author terry.reedy
Recipients terry.reedy
Date 2017-12-23.02:41:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513996869.13.0.213398074469.issue32411@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-12-23 02:41:09terry.reedysetrecipients: + terry.reedy
2017-12-23 02:41:09terry.reedysetmessageid: <1513996869.13.0.213398074469.issue32411@psf.upfronthosting.co.za>
2017-12-23 02:41:08terry.reedylinkissue32411 messages
2017-12-23 02:41:07terry.reedycreate