Stefan Behnel <stefan...@behnel.de> added the comment:

Thanks to the discussion that rhettinger triggered on python-dev, it seems that 
there is a majority accordance for considering the previous ordering "undefined 
but deterministic" rather than "sorted", and for making the change from 
"arbitrarily sorted" to "user defined" in Py3.8. That matches the current 
status after the merge of the four pull requests, for both ElementTree and 
MiniDOM.

There also seems to be a large fraction of participants that would like to see 
a stdlib way to safely/correctly/easily compare XML output. IMHO, that is 
covered by issue13611, adding a C14N module to ElementTree. There is also a 
(Py2) C14N implementation for minidom, from the now unmaintained PyXML 
package¹, which, according to the license, is already distributed under Python 
copyright. I will try to bring at least the ET module in shape for integration 
before 3.8 beta1.

During the discussions, several ways were shown to achieve deterministic 
behaviour, also across Python releases. My proposal is therefore to *not* add a 
new "sort_attrs" option to the API, with the reasoning that it is a) not 
required for any of the use cases, b) not maintaining compatibility without 
code changes (neither backwards nor forward), and c) not what most people 
actually want who strive for deterministic output. Instead, I think we should 
concentrate on providing and documenting better ways to compare XML output.

¹ 
https://github.com/actmd/PyXML/blob/97f144152878a67cd95dd229fe72e86f19bce706/xml/dom/ext/c14n.py

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34160>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to