This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Should be able to break long numbers across lines
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 2.7
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, rgov
Priority: normal Keywords:

Created on 2014-03-02 01:50 by rgov, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg212533 - (view) Author: Ryan Govostes (rgov) Date: 2014-03-02 01:50
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 \

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'.
msg212534 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2014-03-02 02:09
Please discuss this on the python-ideas mailing list, then if there's interest we'll re-open this issue.

I'm -0 on the idea, but I haven't really thought about it much.
Date User Action Args
2022-04-11 14:57:59adminsetgithub: 65020
2014-03-02 02:09:52eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg212534

resolution: rejected
stage: resolved
2014-03-02 01:50:04rgovcreate