Splitting numeric litterals

candide candide at free.invalid
Wed Jul 14 21:30:24 EDT 2010


The escape sequence \ENTER allows to split a string over 2 consecutive 
lines. On the other hand, it seems impossible to split a numeric 
litteral across multiple lines, compare :

 >>> "1000\
... 000\
... 000"
'1000000000'
 >>> 1000\ 

... 000\
   File "<stdin>", line 2 

     000\
       ^ 

SyntaxError: invalid syntax
 >>>


Is this the general behaviour ? So, how do you edit code containing a 
very very long numeric constant ?



More information about the Python-list mailing list