Feed on

to hash a set in python, you need to make it immutable:

from sets import Set

this_set = frozenset(i)
my_dict[this_set] = 1

Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS