No subject

Yigal Duppen yduppen at xs4all.nl
Tue Jul 23 09:44:34 EDT 2002


>> What datatypes can one use as key in a dictionary?
> anything immutable. thats numbers, strings, tumples

And of course any object that implements the __hash__(self) method.

(Note: it is usually a good idea only to implement __hash__ for 
immutable objects; hashing mutable objects can give very... interesting 
results)

YDD
-- 
.sigmentation Fault



More information about the Python-list mailing list