PEP 218 Re: ANN: set-0.1 module available

Bjorn Pettersen BPettersen at NAREX.com
Fri May 17 16:35:23 EDT 2002


> From: Erik Max Francis [mailto:max at alcyone.com] 
> 
> "James J. Besemer" wrote:
> 
> > "Denis S. Otkidach" wrote:
> > 
> > > On Thu, 16 May 2002, Roman Suzi wrote:
> > >
> > > That's to complex.  Maybe sets should be always immutable like 
> > > tuples?
> > 
> > Python has clear precedent for doing so, in that strings, 
> tuples and 
> > long integers all are immutable.
> 
> Why is that a precedent?  Lists aren't immutable, and you're 
> as likely to want to add and remove objects from a set as you 
> are to modify a list.

>From the experience with our set class here, sets are never modified
once they're created. What is frequent is creating new sets based on the
union, intersection, and set difference of two sets, but there is almost
always a requirement that the original set stays the same. YMMV of
course :-)

Personally, I would be more than happy if Tim Peter's Python
implementation of a set was put in the std lib (I don't really care that
much about performance though as long as I have the functionality...)

-- bjorn





More information about the Python-list mailing list