[Python-ideas] Improve readability of long numeric literals

Ian Kelly ian.g.kelly at gmail.com
Tue Feb 9 17:38:10 EST 2016


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
>
> This has two advantages: 1. is analog to the way string literals work, which
> are concatenated if put next to each other. 2. spaces are already used as
> thousands separator in many european languages [1].
>
> 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.


More information about the Python-ideas mailing list