dict.has_key(x) versus 'x in dict'

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Wed Dec 6 11:53:52 EST 2006


Andy Dingley wrote:
> Out of interest, whats the Pythonic way to simply cast (sic) the set to
> a list, assuming I don't need it sorted?  The list comprehension?

mySet  = set(myList)
myList = list(mySet)

-- 
Roberto Bonvallet



More information about the Python-list mailing list