Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74211

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

Date 2014-07-08 22:10 +0200
From "Anders J. Munch" <2014@jmunch.dk>
Organization .
Subject Re: [Python-Dev] == on object tests identity in 3.x
References (4 earlier) <53BB6D5F.1010800@btinternet.com> <87a98ktjv7.fsf@uwakimon.sk.tsukuba.ac.jp> <CAPTjJmpvyvw81fY899mkuaui2d4u4dXr=2Vtz9z+JusOS=7DkA@mail.gmail.com> <8761j8thf5.fsf@uwakimon.sk.tsukuba.ac.jp> <20140708165745.GJ13014@ando>
Newsgroups comp.lang.python
Message-ID <mailman.11662.1404850261.18130.python-list@python.org> (permalink)

Show all headers | View raw


Steven D'Aprano wrote:

> - Dropping reflexivity preserves the useful property that NANs compare
>    unequal to everything.

Please present an example from real life where that turned out useful, and earn 
yourself a beer!
I've only experienced examples to the contrary.

> - Keeping reflexivity for NANs would have implied some pretty nasty
>    things, e.g. if log(-3) == log(-5), then -3 == -5.

 >>> log(-3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: math domain error

You were perhaps referring to the log functions in C and Fortran, not math.log?
The tradeoffs are different in those languages, so choices the IEEE-754 
committee made with C and Fortran in mind may be less relevant for Python.

regards, Anders

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: [Python-Dev] == on object tests identity in 3.x "Anders J. Munch" <2014@jmunch.dk> - 2014-07-08 22:10 +0200

csiph-web