On Mon, Dec 30, 2019 at 08:30:41AM +1100, Chris Angelico wrote: > > Especially since it fails quite a few commonsense tests for whether or > > not something is a number: [...] > > The answer in all four cases is No. If something doesn't quack like a > > duck, doesn't swim like a duck, and doesn't walk like a duck, and is > > explicitly called Not A Duck, would we insist that it's actually a duck? > > Be careful: This kind of logic and intuition doesn't always hold true > even for things that we actually DO call numbers. The counting numbers > follow logical intuition, but you can't count the number of spoons on > a table and get a result of "negative five" or "the square root of > two" or "3 + 2i".
That's because none of those examples are counting numbers :-) My set of "commonsense tests" weren't intended to be an exhaustive or bulletproof set of tests for numberness. They were intended to be simple, obvious and useful tests: if it quacks, swims and walks like a duck, it's probably a duck. The silent Legless Burrowing Duck being a rare exception.[1] We could extend those duck tests appropriately to cover more exotic kinds of numbers: - could your credit card have a balance of NAN dollars or euros? - might the amount of spin of a space craft be NAN? http://danceswithcode.net/engineeringnotes/quaternions/quaternions.html https://thatsmaths.com/2018/10/04/the-many-modern-uses-of-quaternions/ but the answers will still be "No". NANs are artifacts of the system of computation in use, they don't represent a physical measurement: they represent (e.g.) an "out of bounds" error: 1e10000 - 1e9000 returns NAN or some kind of "impossible value" or "there is no answer" placeholder. (These interpretations aren't intended to be exhaustive.) If your bank statement reported your balance as "NAN", that would be a clear programming error, not the actual balance. If your bogometer measured the bogosity of a something as NAN micro- lenarts, that would indicate a failure of the bogometer, not an actual measurement. (Any similarity between the microlenart and the creator of systemd is purely coincidental.) http://itre.cis.upenn.edu/~myl/languagelog/archives/003515.html [1] Not actually a real duck. But it could be. -- 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/AX5DEZVZLPH6PVHP6BSD44QQGDEDZYJJ/ Code of Conduct: http://python.org/psf/codeofconduct/