I've been doing some work with large ints, of well over 100 digits. For
example, this number has 131 digits:
P =
29674495668685510550154174642905332730771991799853043350995075531276838753171770199594238596428121188033664754218345562493168782883
Sometimes I'm tempted to write numbers like that as follows:
P = int('29674495668685510550154174642905332730771991'
'79985304335099507553127683875317177019959423'
'8596428121188033664754218345562493168782883')
which is nicer to read, except for the minor annoyance of the call to
int and the string delimiters.
That got me thinking that it might be Nice To Have if we could split
long int literals across multiple lines:
P = 29674495668685510550154174642905332730771991\
79985304335099507553127683875317177019959423\
8596428121188033664754218345562493168782883
Or if you don't like backslashes, trailing underscores are currently
illegal, so we could use them:
P = 29674495668685510550154174642905332730771991_
79985304335099507553127683875317177019959423_
8596428121188033664754218345562493168782883
Thoughts?
--
Steven
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/2NCIAUM4O55BWHHO7RMZNRPDUYM3JWYT/
Code of Conduct: http://python.org/psf/codeofconduct/