[New-bugs-announce] [issue20821] Should be able to break long numbers across lines

Ryan Govostes report at bugs.python.org
Sun Mar 2 02:50:04 CET 2014


New submission from Ryan Govostes:

I cannot find a way to break a long number across multiple lines, other than to write the number as a string, take advantage of string literal concatenation, and then convert the string to an integer.

I'd like to be able to write, for example,

N = 17976931348623159077293051907890247336179769789423065727343008115 \
    77326758055056206869853794492129829595855013875371640157101398586 \
    47833778606925583497541085196591615128057575940752635007475935288 \
    71082364994994077189561705436114947486504671101510156394068052754 \
    0071584560878577663743040086340742855278549092581

To support this, adjacent integer literals should be concatenated also.

I don't think this would introduce any backwards-compatibility issues.

My preference would be to require each literal be written with its prefix, e.g., '0xDEAD 0xBEEF'. It strikes me as poor style to mix different bases, e.g., '0xa 5'.

----------
components: Interpreter Core
messages: 212533
nosy: rgov
priority: normal
severity: normal
status: open
title: Should be able to break long numbers across lines
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20821>
_______________________________________


More information about the New-bugs-announce mailing list