[Python-ideas] Improve readability of long numeric literals

Chris Angelico rosuav at gmail.com
Tue Feb 9 20:39:08 EST 2016


On Wed, Feb 10, 2016 at 12:35 PM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> On 10 February 2016 at 01:07, Ethan Furman <ethan at stoneleaf.us> wrote:
>>
>> and in talking about int() accepting underscored inputs:
>>
>>> It seems entirely harmless here. Also for float().
>
> I don't agree with either of those. Syntax accepted by int() is less
> permissive than for int literals (e.g. int('0x1')) which is good
> because int is often used to process data form external sources.

+1. Keep int() as it is, so we don't get weird stuff happening and
causing confusion.

But I'm +1 on allowing underscores between digits (not straight after
a decimal point in a float, though, as it looks like attribute
access).

ChrisA


More information about the Python-ideas mailing list