can a class instance ever be hashable?

Alex cut_me_out at hotmail.com
Thu Sep 21 22:14:16 EDT 2000


> The basic question is whether the attributes that make up the hash can
> be changed by the class user after the instance is created.  If the
> answer is "yes", then the class is mutable and you can't hash it.

Actually, Aahz, you can hash mutable classes, although changing it
behind the hashing machinery's back in the way you describe can shoot
you in the foot pretty badly.

Alex.

-- 
Speak softly but carry a big carrot.



More information about the Python-list mailing list