[Tutor] Best Known Method for Filtering redundant list items.

Tor Hildrum torhildrum at gmail.com
Fri Dec 1 10:34:18 CET 2006

On 11/30/06, John Fouhy <john at fouhy.net> wrote:

> For the same reason that dictionaries don't preserve order.
> Basically, sets are (I think) implemented using a hash table.  You can
> read about hash tables on wikipedia (or many other places), but one of
> the components of a hash table is a function mapping keys to integers
> in a particular range.

Why not just call a sigar for a sigar.

A set is a set, it may be implemented using a hash or it may be
implemed using some other datastructure. It could be implemented using
lists which preserves order, all though that doesn't make much sense.
How it is implemented does not really matter here.


If you want a collection of ordered objects, you don't want a set. Not
even if the current implementation of sets in Python did preserve
order. Doing so could not be considered as anything else than a ugly
hack or exploitation of the current implementation. And would be
likely to break in the future.


More information about the Tutor mailing list