Python: Container object that preserves ordering and enforces uniqueness?

Posted by Infinity on Stack Overflow See other posts from Stack Overflow or by Infinity
Published on 2010-05-13T22:03:29Z Indexed on 2010/05/13 22:04 UTC
Read the original article Hit count: 150

Filed under:

Is there anything like this in the standard library? I've looked but haven't found it.

It needs to be like a list (preserves order) but also like a set (elements can only appear once).

So if you give it ['a', 'b', 'a'] it should return ['a', 'b']

Thanks!

© Stack Overflow or respective owner

Related posts about python