Message321976
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. |
|
Date |
User |
Action |
Args |
2018-07-20 04:46:12 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, scoder, eli.bendersky |
2018-07-20 04:46:12 | serhiy.storchaka | set | messageid: <1532061972.5.0.56676864532.issue34160@psf.upfronthosting.co.za> |
2018-07-20 04:46:12 | serhiy.storchaka | link | issue34160 messages |
2018-07-20 04:46:12 | serhiy.storchaka | create | |
|