Modules are hashable?!

Alex Martelli aleaxit at yahoo.com
Wed Sep 1 14:35:31 CEST 2004


Jason Lai <jmlai at uci.edu> wrote:
   ...
> Lists, tuples, dicts, strings, and a few other things are odd in that
> they're hashed/compared by their contents rather than ID. So you can 
> have two different objects that are equivalent with regards to hashing
> or comparing.

Two _distinct_ objects that are not different, actually (this also
applies to numbers -- their values get compared, not their identities).
I think you have the right ideas, just trying to perfect your choice of
words here -- distinct vs different.  I think the best usage is:

"A is different from B" -> "A != B"
"A is distinct from B" -> "A  is not B"

> I think that's how it works, anyway :P

Pretty much, yes.


Alex



More information about the Python-list mailing list