[Tutor] mistaken about splitting expressions over lines

Peter Otten __peter__ at web.de
Tue Jun 25 17:35:04 CEST 2013


eryksun wrote:

> Constant folding for binary operations has a length limit of 20 for
> sequences:
> 
>     >>> dis.dis(lambda: '0123456789' + '0123456789' + '0')
>       1           0 LOAD_CONST               3 ('0123456789
>                                                  0123456789')
>                   3 LOAD_CONST               2 ('0')
>                   6 BINARY_ADD
>                   7 RETURN_VALUE

Interesting. Do you know why the limit is so low (especially for strings)?



More information about the Tutor mailing list