On Friday 24 June 2005 05:26 pm, infidel wrote: > dict((x, None) for x in alist)
or if you want it to run in 2.3 (before "generator expressions"): dict( [(x,None) for x in alist] ) Before the dict constructor, you needed to do this: d={} for key in alist: d[key]=None which is still only 3 lines and will run in Python 1.5, IIRC. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list