[Python-Dev] == on object tests identity in 3.x

Steven D'Aprano steve at pearwood.info
Tue Jul 8 19:00:46 CEST 2014


On Tue, Jul 08, 2014 at 04:58:33PM +0200, Anders J. Munch wrote:

> For two NaNs computed differently to compare equal is no worse than 2+2 
> comparing equal to 1+3.  You're comparing values, not their history.

a = -23
b = -42
if log(a) == log(b):
    print "a == b"


-- 
Steven


More information about the Python-Dev mailing list