[Python-Dev] Is XML serialization output guaranteed to be bytewise identical forever?
On Thu, 21 Mar 2019 02:07:01 +0100
Victor Stinner <vstinner at redhat.com> wrote:
> Le lun. 18 mars 2019 ? 23:41, Raymond Hettinger
> <raymond.hettinger at gmail.com> a ?crit :
> > The code in the current 3.8 alpha differs from 3.7 in that it removes attribute sorting and instead preserves the order the user specified when creating an element. As far as I can tell, there is no objection to this as a feature.
> By the way, what's the rationale of this backward incompatible change?
> I found this short message:
> "FWIW, this issue arose from an end-user problem. She had a hard
> requirement to show a security clearance level as the first attribute.
> We did find a work around but it was hack."
> It's the first time that I hear an user asking to preserve attribute
> insertion order (or did I miss a previous request?). Technically, it
> was possible to implement the feature earlier using OrderedDict. So
> why doing it now?
> Is it really worth it to break Python backward compatibility (change
> the default behavior) for everyone, if it's only needed for few users?
The argument you're making is weird here. If only "a few users" need a
deterministic ordering of XML attributes, then compatibility is broken
only for "a few users", not for "everyone".
Most users and applications should /never/ care about the order of XML