[Python-ideas] 1 246 358

MRAB python at mrabarnett.plus.com
Sat May 7 02:55:52 CEST 2011


On 07/05/2011 01:44, Ben Finney wrote:
> Greg Ewing<greg.ewing at canterbury.ac.nz>  writes:
>
>> An alternative would be to allow spaces.
>
> I would prefer to allow space between digits in a numeric literal.
>
>      1 2345 6789
>      1 2 3 4 5 6789
>      1 234 6789
>      1  234   567 89
>      9.876 543 210
>      0xFEFF 0042
>
> This nicely parallels the fact that space can separate chunks of a
> string literal.
>
> But that still leaves the following inconsistency:
>
>      int('1 234 567')
>
> That will currently raise a ValueError. Should it continue to do so
> under this proposal?
>
I prefer there not to be whitespace inside tokens. String literals are
an exception, they are explicitly delimited.



More information about the Python-ideas mailing list