Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:
dictionary's insertion order is preserved in 3.6 and above. Hence sorting by lexical order was removed in issue34160 and there is a discussion in the same issue to add an option to provide sorted output. As part of triaging I propose closing this issue since the changes were made in issue34160. $ ./python.exe Python 3.8.0a0 (heads/master:cd449806fa, Nov 12 2018, 09:51:24) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element, tostring >>> from collections import OrderedDict >>> e = Element("tag", OrderedDict([("a", "a"), ("c", "c"), ("b", "b")])) >>> tostring(e) b'<tag a="a" c="c" b="b" />' >>> e = Element("tag", dict([("a", "a"), ("c", "c"), ("b", "b")])) >>> tostring(e) b'<tag a="a" c="c" b="b" />' ---------- nosy: +xtreak _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue20198> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com