On 17 August 2012 18:52, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Aug 18, 2012 at 5:27 AM, Guido van Rossum <gu...@python.org> wrote: >> I just fixed a unittest for some code used at Google that was >> comparing a url generated by urllib.encode() to a fixed string. The >> problem was caused by turning on PYTHONHASHSEED=1. Because of this, >> the code under test would generate a textually different URL each time >> the test was run, but the intention of the test was just to check that >> all the query parameters were present and equal to the expected >> values. >> >> >> query = sorted(query.items()) > > Hmm. ISTM this is putting priority on the unit test above the > functionality of actual usage. Although on the other hand, sorting > parameters on a URL is nothing compared to the cost of network > traffic, so it's unlikely to be significant. >
I don't think this behavior is only desirable to unit tests: having URL's been formed in predictable way a good thing in any way one thinks about it. js -><- > Chris Angelico > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com