Author serhiy.storchaka
Recipients eli.bendersky, rhettinger, scoder, serhiy.storchaka
Date 2018-07-20.04:46:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532061972.5.0.56676864532.issue34160@psf.upfronthosting.co.za>
In-reply-to
Content
Attributes are sorted by name when converted an element to the text representation for making it stable. Changing this may break existing software.

I think it makes sense now to add an optional keyword-only parameter sort_attrs (True by default) for functions tostring() and tostringlist() and method ElementTree.write(). If it is False, attributes will keep the original order.

Since dump() is used for debugging only, it could change the behavior by default, even in maintained releases. But currently it just uses ElementTree.write(), which should sort attributes by default for compatibility.
History
Date User Action Args
2018-07-20 04:46:12serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, scoder, eli.bendersky
2018-07-20 04:46:12serhiy.storchakasetmessageid: <1532061972.5.0.56676864532.issue34160@psf.upfronthosting.co.za>
2018-07-20 04:46:12serhiy.storchakalinkissue34160 messages
2018-07-20 04:46:12serhiy.storchakacreate