On Mon, Sep 14, 2020 at 11:05 AM Cade Brown <brown.c...@gmail.com> wrote:
> This would become relevant, if, say Python 4.0 migrated 'inf' and 'nan' to 
> builtin names (like True and False). If that happened, a 'nan' singleton 
> wouldn't make sense unless you had 2**53 of them, so code like:
>
>   >>> x is nan
>
> Would be a flawed formulation
>

Nobody's suggesting that they become keywords representing singletons,
which is what True and False are. (At least, I don't think so.) What's
being proposed is simply a builtin name that has a value of
float("inf"). People don't write "x is 1.5" and they shouldn't use "x
is inf". It doesn't matter that there are multiple bit patterns that
represent nan; you shouldn't be doing this even when there's only one
bit pattern for the value. Yes, sometimes people do this with small
integers, and in CPython it may work ("x is 5" will usually be true
for any integer 5), but it's just as buggy there and I don't think
that's particularly relevant.

(How often do people even use "x is True"?)

ChrisA
_______________________________________________
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/PAQQ4J6YHRB6B7HTCR6IQQ2EZN32SOCE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to