[Python-ideas] Python Numbers as Human Concept Decimal System

MRAB python at mrabarnett.plus.com
Fri Mar 7 03:12:59 CET 2014


On 2014-03-07 01:52, Andrew Barnert wrote:
> From: Chris Angelico <rosuav at gmail.com>
>
> Sent: Thursday, March 6, 2014 4:29 PM
>
>
>> So... I'm +1 for adding a literal syntax for decimals. +1 for
>> adding a stating-the-default for floats (do it straight away, then
>> code that uses it can be backported all the way even when there's a
>> change of default).
>
> This makes sense if you also add an optional suffix for binary floats
> at the same time. Otherwise, it would be confusing to talk about the
> "default" when there's no way to make it explicit, and it would delay
> any potential change of the default by at least one version, if not
> more.
>
> Of course there's a lot of room for bikeshedding the suffix. The "f"
> suffix from C implies 32-bit float as opposed to 64-bit double, which
> is obviously wrong. The "d" suffix from C might be confusing as
> distinguishing "binary, not decimal". Maybe "b"?
>
Calling the floating-point class "float" implies 32-bit float as
opposed to 64-bit double, doesn't it? :-)

>> +0.5 for adding a syntax for fractions; support in principle but
>> the devil's in the details.
>
> What details, other than bikeshedding the exact suffix? If 3r ==
> fraction.Fraction(3), we're done, right?
>


More information about the Python-ideas mailing list