On 17 August 2012 18:52, Chris Angelico <rosuav at gmail.com> wrote: > On Sat, Aug 18, 2012 at 5:27 AM, Guido van Rossum <guido at 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 >
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4