[Python-Dev] bool does not want to be subclassed?

"Martin v. Löwis" martin at v.loewis.de
Tue Feb 17 03:03:44 EST 2004


Greg Ewing wrote:
> All these rules can be boiled down to:
> 
>   * Objects which compare equal should hash equal.
>   * The notion of equality should not change over the
>     lifetime of the object.
> 
> There's no need to mention mutability at all.

I find "notion of equality" a fuzzy term: How do I
determine whether it changes? The real requirement is
that the hash of an object must not change.

E.g. the the state of an object may change even if
it contributes to the "notion of equality" if the
state of all other objects changes simultaneously
in the same way.

Regards,
Martin




More information about the Python-Dev mailing list