[Python-ideas] Improve readability of long numeric literals

Chris Angelico rosuav at gmail.com
Tue Feb 9 21:46:18 EST 2016


On Wed, Feb 10, 2016 at 1:18 PM, Joshua Landau <joshua at landau.ws> wrote:
> On 10 February 2016 at 00:45, MRAB <python at mrabarnett.plus.com> wrote:
>> The Ada programming language allows underscores in numerals, but requires
>> there to be a digit on both sides of the underscore.
>
> +1 to this.
>
> Nobody's given an important use-case for any of the odd cases (doubled
> or trailing underscores, or those oddly placed in floats) but there
> are legitimate reasons to want groups of different sizes, especially
> with non-decimal bases. Saying a digit is needed either side is both
> obvious and sufficient.

I'm not sure how that would get encoded into the grammar, but
certainly that's the advice I would recommend for style guides.

ChrisA


More information about the Python-ideas mailing list