[Python-ideas] Python Float Update

Joonas Liik liik.joonas at gmail.com
Mon Jun 1 17:12:52 CEST 2015

I'm sorry..

what i meant was not a literal that results in a Decimal, what i meant was
a special literal proxy object that usualyl acts like a float except you
can ask for its original string form.


flit = 1.3
flit*3 == float(flit)*3
str(flit) == '1.3'

thus in cases where the intermediate float conversion loses precision you
can get at the original string that the programmer actually typed in.

Decimal constructors are one case that woudl probably like to use the
original string whenever possible to avoid conversion losses,
but by no means are they the only ones.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150601/2be661fe/attachment.html>

More information about the Python-ideas mailing list