[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

Terry J. Reedy report at bugs.python.org
Sun Dec 24 22:57:57 EST 2017


Terry J. Reedy <tjreedy at udel.edu> added the comment:

(f0, C0) is the correct insertion and line number order for the dict that would be returned by pyclbr for a fleshed-out file.  After 'sorted' is removed, the mock must imitate that.

One could argue that previously, and even now for 3.6, the initial insertion order should be 'wrong' to test that format_children sorts the return list.  But what is the chance that there will ever be an alternate 3.6 (or even later) implementation that runs tkinter and therefore might run IDLE but has a dict that does not preserve insert order?

I probably should not worry about the dict insert order guarantee being rescinded in a future version.  Maybe instead I should just add a comment that transform_children depends on iteration order being insert order == line-number order.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32411>
_______________________________________


More information about the Python-bugs-list mailing list