On Thu, Apr 28, 2011 at 2:54 PM, Guido van Rossum <gu...@python.org> wrote: >> Well, I didn't say that. If Python changed its behavior for (float('nan') == >> float('nan')), we'd have to seriously consider some changes. > > Ah, but I'm not proposing anything of the sort! float('nan') returns a > new object each time and two NaNs that are not the same *object* will > still follow the IEEE std. It's just when comparing a NaN-valued > *object* to *itself* (i.e. the *same* object) that I would consider > following the lead of Python's collections.
The reason this possibility bothers me is that it doesn't mesh well with the "implementations are free to cache and reuse immutable objects" rule. Although, if the updated NaN semantics were explicit that identity was now considered part of the value of NaN objects (thus ruling out caching them at the implementation layer), I guess that objection would go away. Regards, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com