<div dir="auto"><div>-1</div><div dir="auto"><br></div><div dir="auto">Writing a floating point literal requires A LOT more knowledge than writing a hex integer.</div><div dir="auto"><br></div><div dir="auto">What is the bit length of floats on your specific Python compile? What happens if you specify more or less precision than actually available.  Where is the underflow to subnormal numbers? What is the bit representation of information? Nan? -0 vs +0?</div><div dir="auto"><br></div><div dir="auto">There are people who know this and need to know this. But float.fromhex() is already available to them. A literal is an attractive nuisance for people who almost-but-not-quite understand IEEE-854. I.e. those people who named neither Tim Peters nor Mike Cowlishaw.<div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Sep 21, 2017 9:48 AM, "Lucas Wiman" <<a href="mailto:lucas.wiman@gmail.com">lucas.wiman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="quoted-text">On Thu, Sep 21, 2017 at 8:23 AM, Victor Stinner <span dir="ltr"><<a href="mailto:victor.stinner@gmail.com" target="_blank">victor.stinner@gmail.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote"><div class="quoted-text"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While I was first in favor of extending the Python syntax, I changed<br>
my mind. Float constants written in hexadecimal is a (very?) rare use<br>
case, and there is already float.fromhex() available.<br>
<br>
A new syntax is something more to learn when you learn Python. Is it<br>
worth it? I don't think so. Very few people need to write hexadecimal<br>
constants in their code.<br></blockquote><div><br></div></div><div>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.</div><div dir="auto"><br></div><div dir="auto">- Lucas<br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
<br></blockquote></div><br></div></div></div>