summaryrefslogtreecommitdiff
path: root/Lib/test/test_set.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge p3yk branch with the trunk up to revision 45595. This breaks a fairThomas Wouters2006-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
* Renamed _length_cue() to __length_hint__(). See:Armin Rigo2006-02-111-1/+3
| | | | http://mail.python.org/pipermail/python-dev/2006-February/060524.html
* Improve test coverage. Hope the test_file changes work the same on windows.Neal Norwitz2005-11-271-0/+12
|
* No longer ignore exceptions raised by comparisons during key lookup.Raymond Hettinger2005-09-161-0/+17
| | | | Inspired by Armin Rigo's suggestion to do the same with dictionaries.
* Numerous fix-ups to C API and docs. Added tests for C API.Raymond Hettinger2005-08-161-1/+6
|
* * Fix SF #1257731. Make __contains__(), remove(), and discard() only doRaymond Hettinger2005-08-121-0/+13
| | | | | | | a frozenset conversion when the initial search attempt fails with a TypeError and the key is some type of set. Add a testcase. * Eliminate a duplicate if-stmt.
* * Add short-circuit code for in-place operations with self (such asRaymond Hettinger2005-08-111-0/+12
| | | | | | | | | | | | | | | | | | | | | s|=s, s&=s, s-=s, or s^=s). Add related tests. * Improve names for several variables and functions. * Provide alternate table access functions (next, contains, add, and discard) that work with an entry argument instead of just a key. This improves set-vs-set operations because we already have a hash value for each key and can avoid unnecessary calls to PyObject_Hash(). Provides a 5% to 20% speed-up for quick hashing elements like strings and integers. Provides much more substantial improvements for slow hashing elements like tuples or objects defining a custom __hash__() function. * Have difference operations resize() when 1/5 of the elements are dummies. Formerly, it was 1/6. The new ratio triggers less frequently and only in cases that it can resize quicker and with greater benefit. The right answer is probably either 1/4, 1/5, or 1/6. Picked the middle value for an even trade-off between resize time and the space/time costs of dummy entries.
* * Improve code for the empty frozenset singleton:Raymond Hettinger2005-08-011-0/+20
| | | | | | | | | | | - Handle both frozenset() and frozenset([]). - Do not use singleton for frozenset subclasses. - Finalize the singleton. - Add test cases. * Factor-out set_update_internal() from set_update(). Simplifies the code for several internal callers. * Factor constant expressions out of loop in set_merge_internal(). * Minor comment touch-ups.
* Add test for hash commutativity.Raymond Hettinger2005-07-051-0/+10
|
* SF patch #1200018: Restore GC support to set objectsRaymond Hettinger2005-06-181-0/+10
| | | | | Reverts 1.26 and 1.27. And adds cycle testing.
* SF 1062353: set pickling problemsRaymond Hettinger2004-11-091-3/+9
| | | | Support automatic pickling of dictionaries in instance of set subclasses.
* Use Py_CLEAR(). Add unrelated test.Raymond Hettinger2004-09-281-0/+3
|
* Use floor division operator.Raymond Hettinger2004-09-271-1/+1
|
* * fix the print testRaymond Hettinger2004-07-091-0/+14
| | | | * add more __init__ tests
* Make sets and deques weak referencable.Raymond Hettinger2004-05-301-0/+8
|
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-2/+2
| | | | From SF patch #852334.
* Whitespace normalization.Tim Peters2004-01-181-1/+1
|
* Strengthen the test for hash effectivenessRaymond Hettinger2003-12-311-4/+4
|
* Guido grants a Christmas wish:Raymond Hettinger2003-12-171-5/+5
| | | | sorted() becomes a regular function instead of a classmethod.
* * Checkin remaining documentationRaymond Hettinger2003-11-241-14/+59
| | | | | | | * Add more tests * Refactor and neaten the code a bit. * Rename union_update() to update(). * Improve the algorithms (making them a closer to sets.py).
* * Simplify hash function and add test to show effectiveness of the hashRaymond Hettinger2003-11-231-13/+72
| | | | | | | | | | | | | | | function. * Add a better test for deepcopying. * Add tests to show the __init__() function works like it does for list and tuple. Add related test. * Have shallow copies of frozensets return self. Add related test. * Have frozenset(f) return f if f is already a frozenset. Add related test. * Beefed-up some existing tests.
* Extend temporary hashability to remove() and discard().Raymond Hettinger2003-11-221-0/+10
| | | | Brings the functionality back in line with sets.py.
* Allow temporary hashability for the __contains__ test.Raymond Hettinger2003-11-211-0/+2
| | | | (Requested by Alex Martelli.)
* issubset() and issuperset() to work with general iterablesRaymond Hettinger2003-11-211-0/+4
|
* Various fixups (most suggested by Armin Rigo).Raymond Hettinger2003-11-171-0/+25
|
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-0/+1183
* Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.