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

Andy Dingley dingbat at codesmiths.com
Wed Dec 6 11:45:59 EST 2006


Roberto Bonvallet wrote:

> >        lstBugsChanged = [ bugId for bugId in setBugsChanged ]

> In Python > 2.4:

Hmmm. Thanks. Another reason to twist the admin's arm and get them to
upgrade the last 2.3.4 boxen


>     sorted(setBugsChanged)

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?




More information about the Python-list mailing list