Commit Graph

310 Commits

Author SHA1 Message Date
Raymond Hettinger 49ba4c39c4 * Simplify hash function and add test to show effectiveness of the hash
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.
2003-11-23 02:49:05 +00:00
Raymond Hettinger bfd334a42d Extend temporary hashability to remove() and discard().
Brings the functionality back in line with sets.py.
2003-11-22 03:55:23 +00:00
Raymond Hettinger 19c2d77842 Allow temporary hashability for the __contains__ test.
(Requested by Alex Martelli.)
2003-11-21 18:36:54 +00:00
Raymond Hettinger 3fbec701ca issubset() and issuperset() to work with general iterables 2003-11-21 07:56:36 +00:00
Raymond Hettinger 82d73dd459 Three minor performance improvements:
* Improve the hash function to increase the chance that distinct sets will
  have distinct xor'd hash totals.

* Use PyDict_Merge where possible (it is faster than an equivalent iter/set
  pair).

* Don't rebuild dictionaries where the input already has one.
2003-11-20 22:54:33 +00:00
Guido van Rossum b61982bacb Implement straightforward suggestions from gcc warnings (remove unused
variable, add extra braces).
2003-11-18 19:27:19 +00:00
Raymond Hettinger 1b92fd5bca Use PySequence_Contains() instead of direct access macro. 2003-11-18 14:15:31 +00:00
Raymond Hettinger 50a4bb325c Various fixups (most suggested by Armin Rigo). 2003-11-17 16:42:33 +00:00
Raymond Hettinger e2c277a69f Fix output spacing typo 2003-11-16 16:36:58 +00:00
Raymond Hettinger a690a9967e * Migrate set() and frozenset() from the sandbox.
* 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.
2003-11-16 16:17:49 +00:00