The sets Module
(New in 2.3) A set datatype, based on dictionaries. Supports the usual set operations (intersection, union, membership tests, etc).
In Python 2.4 and later, the set datatype is a built-in. To write code that works for 2.3 and later, you can do:
try: set except NameError: from sets import Set as set