Instead of modifying the Python grammar, the alternative is to enhance
float(str) to support it:

k = float("0x1.2492492492492p-3") # 1/7

Victor

2017-09-08 8:57 GMT+02:00 Serhiy Storchaka <storch...@gmail.com>:
> The support of hexadecimal floating literals (like 0xC.68p+2) is included in
> just released C++17 standard. Seems this becomes a mainstream.
>
> In Python float.hex() returns hexadecimal string representation. Is it a
> time to add more support of hexadecimal floating literals? Accept them in
> float constructor and in Python parser? And maybe add support of hexadecimal
> formatting ('%x' and '{:x}')?
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to