[Python-ideas] Improve readability of long numeric literals

Guido van Rossum guido at python.org
Tue Feb 9 19:16:19 EST 2016


On Tue, Feb 9, 2016 at 4:06 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Ian Kelly <ian.g.kelly at gmail.com> writes:
>
>> On Tue, Feb 9, 2016 at 2:40 PM, Manuel Cerón <ceronman at gmail.com> wrote:
>> > Another option is to use spaces instead of underscores:
>> >
>> >>>> opts.write_buffer_size = 67 108 864
>> >
>> > […]
>> > The disadvantage is that, as far as I known, no other languages do
>> > this.
>>
>> Another disadvantage to using spaces is that it could mask an
>> inadvertently omitted operator that previously would have been a
>> SyntaxError.
>
> The exact same fact – that a proposed new syntax was previously a syntax
> error – is commonly presented as a positive. We know there are no valid
> Python programs already using the construct to mean something else.
>
> So I don't think it's reasonable to present that now as though it were
> negative.

I think you misunderstand. The argument (which I agree with) is that
the syntax error was considered beneficial, since it would catch
common typos -- so that we're loath to make that valid code.

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-ideas mailing list