Delaney, Timothy C (Timothy) wrote:
This is actually one thing that Java 1.5 has that I'd like to see in
Python - the LinkedHashSet and LinkedHashMap. Very useful data
structures.

For those who don't know, these implement a hash set/map which iterates
in the order that the keys were first added to the set/map.

Such a data structure is fairly simple to implement, and removing
duplicates then becomes:

    unique = list(linkedset(orig))

and you're guaranteed to maintain order.

Implementing these is fairly simple.

Sounds like a good candidate for the collections module. Of course someone will need to implement it. ;)


STeVe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to