Mark Devine wrote:
the trouble is it throws up the following error for set:

$ ./test.py
Traceback (most recent call last):
  File "./test.py", line 23, in ?
    reflist = [normalize(element) for element in list1]
  File "./test.py", line 20, in normalize
    return set(text.split())
NameError: global name 'set' is not defined


The set type became a builtin in Python 2.4. I would suggest upgrading, but if this is not an option, you can put this at the top of the file, and it should get rid of the NameError:


from sets import Set as set

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

Reply via email to