<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 19, 2019 at 6:15 AM Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">19.03.19 13:53, Ned Batchelder пише:<br>
> Option 4 is misleading.  Is anyone here really offering to "fix the <br>
> tests in third-party modules"?  Option 4 is actually, "do nothing, and <br>
> let a multitude of projects figure out how to fix their tests, slowing <br>
> progress in those projects as they try to support Python 3.8."<br>
<br>
Any option except option 1 (and option 2 with sorting by default) <br>
requires changing third-party code. You should either pass additional <br>
argument to serialization functions, or use special canonization functions.<br>
<br>
We should look at the problem from long perspective. Freezing the <br>
current behavior forever does not look good. If we need to break the <br>
user code, we should minimize the harm and provide convenient tools for <br>
reproducing the current behavior. And this is an opportunity to rewrite <br>
user tests in more appropriate form. In your case textual comparison may <br>
be the most appropriate form, but this may be not so in other cases.<br></blockquote><div><br></div><div>In situations like this I think it's best to bite the bullet sooner rather than later while acknowledging that folks like Ned are in a bind when they have support older versions and thus have long-term support costs, too, and try to make the transition as painless as possible (my guess is Ned's need to support older versions will drop off faster than us having to support the xml libraries in the stdlib going forward, hence my viewpoint).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Now in Python 3.8, because Python doesn't want to add an <br>
> optional flag to continue doing what it has always done, I need to <br>
> re-engineer my tests.<br>
<br>
Please wait yet some time. I hope to add canonicalization before the <br>
first beta.<br></blockquote><div><br></div><div>For me I think canonicalization/stable pretty-print is the best option, especially if we can put the canonicalization code up on PyPI for supporting older versions of Python. Otherwise a function that does something like an XOR to help diagnose what differs between 2 XML documents is also seems like a good option to me.<br></div></div></div>