<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/test/test_cookie.py, branch v2.2a3</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/test_cookie.py?h=v2.2a3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/test_cookie.py?h=v2.2a3'/>
<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>a bold attempt to fix things broken by MAL's verify patch: import</title>
<updated>2001-01-17T21:51:36Z</updated>
<author>
<name>Fredrik Lundh</name>
<email>fredrik@pythonware.com</email>
</author>
<published>2001-01-17T21:51:36Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f785042433f0c43ed1ba2ba0388fc51d79bcf5c3'/>
<id>urn:sha1:f785042433f0c43ed1ba2ba0388fc51d79bcf5c3</id>
<content type='text'>
'verify' iff it's used by a test module...
</content>
</entry>
<entry>
<title>Marc-Andre must not have run these tests -- they used verify() but</title>
<updated>2001-01-17T21:43:06Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-01-17T21:43:06Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f27cc5bc74372032ce9c42e9f6321458df6da2f7'/>
<id>urn:sha1:f27cc5bc74372032ce9c42e9f6321458df6da2f7</id>
<content type='text'>
didn't import it.  Also got rid of some inconsistent spaces inside
parentheses in test_gzip.py.
</content>
</entry>
<entry>
<title>This patch removes all uses of "assert" in the regression test suite</title>
<updated>2001-01-17T19:11:13Z</updated>
<author>
<name>Marc-André Lemburg</name>
<email>mal@egenix.com</email>
</author>
<published>2001-01-17T19:11:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e'/>
<id>urn:sha1:3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e</id>
<content type='text'>
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
</content>
</entry>
<entry>
<title>Make reindent.py happy (convert everything to 4-space indents!).</title>
<updated>2000-10-23T17:22:08Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2000-10-23T17:22:08Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=004d5e6880940ddbb38460986ac62ee0f1bae97d'/>
<id>urn:sha1:004d5e6880940ddbb38460986ac62ee0f1bae97d</id>
<content type='text'>
</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>
