Tim Peters [Tue, 1 Jun 2004 18:58:04 +0000 (18:58 +0000)]
test_hash(): The test here is different enough from the one in the bug
report that the stats for expected # of collisions are a little higher.
Updated comments accordingly.
Martin v. Löwis [Mon, 31 May 2004 19:40:57 +0000 (19:40 +0000)]
Copy from python-2.3.spec. Incorporate patch #961465:
Including changes from Ian Holsman to build under Red Hat 7.3.
Fixing some problems with the /usr/local path change.
Walter Dörwald [Mon, 31 May 2004 16:29:04 +0000 (16:29 +0000)]
Port the dictionary tests from test_types.py to unittest. Collect as much
mapping tests as possible in mapping_test.py and reuse the tests in
test_dict.py, test_userdict.py, test_weakref.py, test_os.py and test_shelve.py.
From SF patch #736962.
Walter Dörwald [Thu, 27 May 2004 18:16:25 +0000 (18:16 +0000)]
The default argument in dict.setdefault() defaults to None.
Add this default to weakref.WeakValueDictionary.setdefault()
and weakref.WeakKeyDictionary.setdefault() too.
* Updated repr.py to handle set() and frozenset().
* Factored out common code to a single private function.
* Use str.join() instead of + concatenation
* Loop over elements directly instead of using indexing
* Use % operator for formatting
Set data pointer to NULL after an error; this keeps the mmap_dealloc() function from trying to do msync(-1);munmap(-1).
2.3 bugfix candidate, but this bug isn't critical enough that the fix has to go into 2.3.4
SF patch #872326: Generator expression implementation
(Code contributed by Jiwon Seo.)
The documentation portion of the patch is being re-worked and will be
checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's
rationale for the design decisions on binding behavior (as described in
in his patch comments and in discussions on python-dev).
The test file, test_genexps.py, is written in doctest format and is
meant to exercise all aspects of the the patch. Further additions are
welcome from everyone. Please stress test this new feature as much as
possible before the alpha release.
Fred Drake [Tue, 18 May 2004 03:29:52 +0000 (03:29 +0000)]
ConfigParser:
- don't allow setting options to non-string values; raise TypeError
when the value is set, instead of raising an arbitrary exception
later (such as when string interpolation is performed)
- add tests, documentation
(closes SF bug #810843)
Fred Drake [Tue, 18 May 2004 02:25:51 +0000 (02:25 +0000)]
ConfigParser:
- ensure that option names in interpolations are handled by
self.optionxform in the same way that other references to option
names
- add tests, documentation
(closes SF bug #857881, patch #865455)
Tim Peters [Sun, 16 May 2004 05:36:30 +0000 (05:36 +0000)]
test_alias_nofallback(): Someone broke this test, after 2.3, by
converting it into assertRaises() form. Restored the 2.3 code, and
explained why assertRaises() cannot be used instead.
Barry Warsaw [Thu, 13 May 2004 20:17:51 +0000 (20:17 +0000)]
readline(): RFC 2046, section 5.1.2 (and partially 5.1) both state that the
parser must recognize outer boundaries in inner parts. So cruise through the
EOF stack backwards testing each predicate against the current line.
There's still some discussion about whether this is (always) the best thing to
do. Anthony would rather parse these messages as if the outer boundaries were
ignored. I think that's counter to the RFC, but might be practically more
useful. Can you say behavior flag? (ug).
Make sure "del d[n]" is properly supported. Was necessary because the
same method that implements __setitem__ also implements __delitem__.
Also, there were several good use cases (removing items from a queue
and implementing Forth style stack ops).
Barry Warsaw [Tue, 11 May 2004 20:19:09 +0000 (20:19 +0000)]
_parsegen(): Move the message/rfc822 clause to after the
message/delivery-status clause, and genericize it to handle all (other)
message/* content types. This lets us correctly parse 2 more of Anthony's
MIME torture tests (specifically, the message/external-body examples).