[Python-ideas] Hexadecimal floating literals
Lucas Wiman
lucas.wiman at gmail.com
Thu Sep 21 12:47:19 EDT 2017
On Thu, Sep 21, 2017 at 8:23 AM, Victor Stinner <victor.stinner at gmail.com>
wrote:
> While I was first in favor of extending the Python syntax, I changed
> my mind. Float constants written in hexadecimal is a (very?) rare use
> case, and there is already float.fromhex() available.
>
> A new syntax is something more to learn when you learn Python. Is it
> worth it? I don't think so. Very few people need to write hexadecimal
> constants in their code.
>
It is inconsistent that you can write hexadecimal integers but not floating
point numbers. Consistency in syntax is *fewer* things to learn, not more.
That said, I agree it's a rare use case, so it probably doesn't matter much
either way.
- Lucas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170921/35610837/attachment.html>
More information about the Python-ideas
mailing list