A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-February/042593.html below:

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

[Python-Dev] bool does not want to be subclassed?Phillip J. Eby pje at telecommunity.com
Tue Feb 17 09:27:43 EST 2004
At 08:55 AM 2/17/04 +0100, Martin v. Löwis wrote:
>Phillip J. Eby wrote:
>>Actually, it might be even better to start with equality.  Hashing is 
>>only meaningful for objects that can be tested for equality.
>
>However, in Python, all objects can be tested for equality. So hashing
>is meaningful for all objects?
>
>It is not: it is only meaningful for objects which compare equal to the
>same other objects over their lifespan.

That's not valid logic; "X is only meaningful for Y" means that X implies 
Y, not the other way around.  The fact that Y is a tautology doesn't imply 
that X is true, in fact if Y is a tautology then it only proves that "X 
implies Y" is true, because everything implies Y.

However, I see your point that it's therefore silly to talk about things 
that imply a tautology.  :)  Anyway, if you read the rest of my post, you'd 
see that I explained the "lifespan" issue with a bit more precision than 
you have stated above.  For example, I pointed out that it isn't necessary 
for an object to compare equal to the same other objects over its lifespan, 
only over the lifespan following its first __hash__ invocation.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4