Sets in Python

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Sep 21 09:25:53 CEST 2007


En Thu, 20 Sep 2007 08:46:29 -0300, Steven D'Aprano  
<steve at REMOVE-THIS-cybersource.com.au> escribi�:

> Another way is to use this class:
>
> class HashableList(list):
>     def __hash__(self):
>         return hash(tuple(self))

...and that will stop working as soon as the list is mutated (which is  
exactly what you said before)

-- 
Gabriel Genellina




More information about the Python-list mailing list