can a class instance ever be hashable?

Aahz Maruch aahz at panix.com
Fri Sep 22 04:27:45 CEST 2000


In article <etdbsxhi35z.fsf at steve-dallas.mit.edu>,
Alex  <cut_me_out at hotmail.com> wrote:
>attribution restored for Aahz after Alex deleted it:
>>
>> 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.

I was using "can't" in the sense of "must not" rather than
"theoretically impossible".  Kind of like, "You can't go faster than the
speed limit."
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Member of the Groucho Marx Fan Club  --Aahz



More information about the Python-list mailing list