I\'m trying to learn python and I was trying to write something simple. I am developing under Pydev (Eclipse) using OS X 10.8. I installed python 3.2 using the 64bits .dmg i
In every recent python version sets are builtin as set and Python 3 got rid of the deprecated sets module altogether.
If you wanted to ensure that the code also works with ancient versions you could do something like this though:
try:
set
except NameError:
from sets import Set as set
If you need to run old code and don't want to change it (bad!):
try:
from sets import Set
except ImportError:
Set = set