PEP 218 Re: ANN: set-0.1 module available

Roman Suzi rnd at onego.ru
Sun May 19 02:25:46 EDT 2002


If I understand correctly, our discussion rotates around
two axes:

hashable/unhashable items: 
-------------------------

- Set must support any objects found in Python system,
otherwise people could just use dicts to the same results.

mutable/immutable set:
---------------------

- mutable sets are more practical. If one needs to use set as a dict key,
let him convert it to sorted tuple and do so. I think, it's a rare case.
Much more rare than need to append element to the set.

My idea is that sets should be as lists, but with special
set of operations and not allowing doubles.

I even thought, sets could be based purely as unordered, without
duplicates collection of "pointers" to objects but due to the following:

>>> a = "ab"
>>> b = "a" +"b"
>>> id(a)
135509000
>>> id(b)
135171664

it is not so appealing idea... 

So, my understanding is: if sets are into Python, they need
to be as powerful, as possible. Otherwise dictionary keys
will be preferred by people.

My votes:

unhashable (general) items +1
mutable sets               +1

Sincerely yours, Roman Suzi
-- 
\_ Russia \_ Karelia \_ Petrozavodsk \_ rnd at onego.ru \_
\_ Sunday, May 19, 2002 \_ Powered by Linux RedHat 7.2 \_
\_ "It's not the principle of the thing, it's the money" \_







More information about the Python-list mailing list