I'm sorry Marco, you seem to have changed the subject line to discuss 
the set API and sorting, but then went on to discuss NANs without 
mentioning sets or sorting.

Regarding NANs:

Marco said:

> > > This is because NaN, IMHO, it's not the right name
> > > for the entity. A number can't be Not a Number. It's an Undefined Number.

You are correct that numbers cannot be "Not a Number". But NANs aren't 
numbers. They are floats, which tells you the *type* of data they are 
(not a string, not an int, not a list, not a bool, but a float). But 
floats aren't necessarily numbers. Some floats are numbers (1.0, 7.5, 
-2.25 etc) but some floats are not numbers, they represent a non-numeric 
value which is called "Not A Number" or NAN by the standard that defines 
them and their behaviour.

We cannot assume that since *some* floats are numbers, *all* floats are 
numbers. That's simply wrong.

In Go, "runes" (Unicode code points) are represented by 32-bit integers. 
But not all runes are valid Unicode code points: some of them are code 
points, but some of them are just... something else. "Not a code point" 
perhaps.

Going against the name "NAN" is a losing proposition. You're arguing 
against the standard, and every programming language which follows the 
standard. And even if you convinced everyone to use "Undefined Number" 
instead, you're left with an even more confusing situation: what on 
earth is an undefined number? Is it related to (say) the Javascript 
Undefined value? Is an undefined number what you get when you declare a 
variable as an int but don't define it?

    number: int



-- 
Steven
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/AKQILYSNVGQ77GC2BV6XZXHEYUD3BNM3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to