[Python-ideas] Improve readability of long numeric literals

Paul Moore p.f.moore at gmail.com
Wed Feb 10 08:10:48 EST 2016


On 10 February 2016 at 11:37, Alexander Heger <python at 2sn.net> wrote:
>>>>> opts.write_buffer_size = 67108864
>>
>> The disadvantage is that, as far as I known, no other languages do this.
>
> This is not true.  It is absolutely legal in FORTRAN
>
>       program f
>       print*, 123 456
>       end
>
> will just print the number 123456.  Hence for me as a FORTRAN this
> would seem a natural thing to do.  Better than the underscores ... I
> would associate the with the LaTeX maths mode index operator, and then
> I would read 100_002 as the number 4.

But to be fair, in older fortrans at least (I'd like to hope it's got
more sane these days) wasn't

pro gr a     m f
p   r i n      t*,1 2 3 4 5 6
e        nd

just as valid? (IIRC, whitespace was ignored everywhere, even within
keywords...)

Paul


More information about the Python-ideas mailing list