create lowercase strings in lists - was: (No subject)
Mark Devine
markdevine at eircom.net
Fri Dec 17 04:52:54 EST 2004
Thanks. This version is the version that comes with cygwin. They must be behind.
Steven Bethard <steven.bethard at gmail.com> wrote:
>
> 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
>
_________________________________________________________________
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer
More information about the Python-list
mailing list