grumble at usa.net
Wed May 30 15:46:14 CEST 2001
Tim Peters <tim.one at home.com> wrote:
> [Greg Ewing]
>> You would have to be careful how you implemented
>> this, because
>> x + "foo" + "blarg"
>> could have very different results from
>> x + "fooblarg"
>> depending on what sort of thing x is bound to.
> x + 1 + 2
> x + 3
Sure. 'x + 1 + 2' parses into:
so the parser would never see the [false] opportunity to merge 1 and
2. I'm not talking about some fancy analysis of the parse tree, just
something like constant-folding.
More information about the Python-list