Splitting numeric litterals

candide candide at free.invalid
Wed Jul 14 22:37:57 EDT 2010


MRAB a écrit :

> want to split them over several lines. It is somewhat unusual to have a
> _numeric_ literal that's very very long!
> 

I agree. But consider RSA-155 for instance ... ;)


> For an integer literal you could use a string literal and convert it to
> an integer:
> 
>  >>> int("1000\
> 000\
> 000")
> 1000000000
>  >>>

OK.

In C, the following code is allowed :

int x=1000\
000\
000;

but not very usefull for sure !



More information about the Python-list mailing list