<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/test/output/test_cookie, branch 2.3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/output/test_cookie?h=2.3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/output/test_cookie?h=2.3'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-05-13T00:19:31Z</updated>
<entry>
<title>Get rid of the superstitious "~" in dict hashing's "i = (~hash) &amp; mask".</title>
<updated>2001-05-13T00:19:31Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-05-13T00:19:31Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2f228e75e4d5ac8c3eb4a6334dbc43243bff1095'/>
<id>urn:sha1:2f228e75e4d5ac8c3eb4a6334dbc43243bff1095</id>
<content type='text'>
The comment following used to say:
	/* We use ~hash instead of hash, as degenerate hash functions, such
	   as for ints &lt;sigh&gt;, can have lots of leading zeros. It's not
	   really a performance risk, but better safe than sorry.
	   12-Dec-00 tim:  so ~hash produces lots of leading ones instead --
	   what's the gain? */
That is, there was never a good reason for doing it.  And to the contrary,
as explained on Python-Dev last December, it tended to make the *sum*
(i + incr) &amp; mask (which is the first table index examined in case of
collison) the same "too often" across distinct hashes.

Changing to the simpler "i = hash &amp; mask" reduced the number of string-dict
collisions (== # number of times we go around the lookup for-loop) from about
6 million to 5 million during a full run of the test suite (these are
approximate because the test suite does some random stuff from run to run).
The number of collisions in non-string dicts also decreased, but not as
dramatically.

Note that this may, for a given dict, change the order (wrt previous
releases) of entries exposed by .keys(), .values() and .items().  A number
of std tests suffered bogus failures as a result.  For dicts keyed by
small ints, or (less so) by characters, the order is much more likely to be
in increasing order of key now; e.g.,

&gt;&gt;&gt; d = {}
&gt;&gt;&gt; for i in range(10):
...    d[i] = i
...
&gt;&gt;&gt; d
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
&gt;&gt;&gt;

Unfortunately. people may latch on to that in small examples and draw a
bogus conclusion.

test_support.py
    Moved test_extcall's sortdict() into test_support, made it stronger,
    and imported sortdict into other std tests that needed it.
test_unicode.py
    Excluced cp875 from the "roundtrip over range(128)" test, because
    cp875 doesn't have a well-defined inverse for unicode("?", "cp875").
    See Python-Dev for excruciating details.
Cookie.py
    Chaged various output functions to sort dicts before building
    strings from them.
test_extcall
    Fiddled the expected-result file.  This remains sensitive to native
    dict ordering, because, e.g., if there are multiple errors in a
    keyword-arg dict (and test_extcall sets up many cases like that), the
    specific error Python complains about first depends on native dict
    ordering.
</content>
</entry>
<entry>
<title>Since Guido fiddled Cookie.py to work with doctest, it's a Good Thing to</title>
<updated>2001-04-06T21:20:58Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-04-06T21:20:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=eb26f9590691b502db69e26ff441abec7fbd4d47'/>
<id>urn:sha1:eb26f9590691b502db69e26ff441abec7fbd4d47</id>
<content type='text'>
have the std test suite exercise the Cookie doctests too.
</content>
</entry>
<entry>
<title>Added test for patch #103473: test an unquoted cookie value containing '='</title>
<updated>2001-02-21T01:17:54Z</updated>
<author>
<name>Andrew M. Kuchling</name>
<email>amk@amk.ca</email>
</author>
<published>2001-02-21T01:17:54Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=8b94b1c74a5d81ec0db14b0f1d4b65e6b592a680'/>
<id>urn:sha1:8b94b1c74a5d81ec0db14b0f1d4b65e6b592a680</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Show '\011', '\012', and '\015' as '\t', '\n', '\r' in strings.</title>
<updated>2001-01-24T17:19:08Z</updated>
<author>
<name>Ka-Ping Yee</name>
<email>ping@zesty.ca</email>
</author>
<published>2001-01-24T17:19:08Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=fa004ad36c86f4af406cfa3a84ec8b6cb391e6dd'/>
<id>urn:sha1:fa004ad36c86f4af406cfa3a84ec8b6cb391e6dd</id>
<content type='text'>
Switch from octal escapes to hex escapes for other nonprintable characters.
</content>
</entry>
<entry>
<title>Updated test suite: test repr() and str() of cookies, and test metadata</title>
<updated>2000-08-24T11:56:19Z</updated>
<author>
<name>Andrew M. Kuchling</name>
<email>amk@amk.ca</email>
</author>
<published>2000-08-24T11:56:19Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=103d5268c2f40d79c12bee53dd97ff316043f92c'/>
<id>urn:sha1:103d5268c2f40d79c12bee53dd97ff316043f92c</id>
<content type='text'>
    fields with quoted values (as in Path="/acme")
</content>
</entry>
<entry>
<title>Adding tests of the "attrs" optional argument, and of the js_output</title>
<updated>2000-08-19T15:57:33Z</updated>
<author>
<name>Moshe Zadka</name>
<email>moshez@math.huji.ac.il</email>
</author>
<published>2000-08-19T15:57:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=514a1028a20b4a818aa1f75dd674c5ee78a2f5ae'/>
<id>urn:sha1:514a1028a20b4a818aa1f75dd674c5ee78a2f5ae</id>
<content type='text'>
functionality.
</content>
</entry>
<entry>
<title>Test case for Cookie.py</title>
<updated>2000-08-19T15:21:12Z</updated>
<author>
<name>Andrew M. Kuchling</name>
<email>amk@amk.ca</email>
</author>
<published>2000-08-19T15:21:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=cdec8c746b87f1df5c7c58c4e2b205914b16ef19'/>
<id>urn:sha1:cdec8c746b87f1df5c7c58c4e2b205914b16ef19</id>
<content type='text'>
</content>
</entry>
</feed>
