[Patches] [Patch #102627] A Set class which *can* use the .firstkey() patch

noreply@sourceforge.net noreply@sourceforge.net
Wed, 6 Dec 2000 01:25:39 -0800


Patch #102627 has been updated. 

Project: python
Category: core (C code)
Status: Open
Submitted by: moshez
Assigned to : Nobody
Summary: A Set class which *can* use the .firstkey() patch

Follow-Ups:

Date: 2000-Dec-03 04:47
By: moshez

Comment:
OK, this patch implements a Set class with an added advantage that on 102626-patched interpreter it has a method called .element() which returns some element of the set.

Short summary:

* supports boolean operators, substraction
* supports iteration semi-efficiently
* supports checking for containment semi-efficiently
* supports auto-freezing when hash() is called, so can
  be used as key in dictionaries, and so, as an element
  in sets.

Greg Wilson: see if this doesn't solve 95% of the problem
you're trying to solve with the Set built-in type PEP.

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102627&group_id=5470