May 18, 2021
12:09 a.m.
Ethan Furman wrote:
On 5/17/2021 6:13 AM, Mark Shannon wrote:
Where i1, i2 are integers and s1 is a string.
i1 + i2 + s1 ^^^^^^^^^^^^ Wouldn't the carets just be under the i2 + s1 portion?
I don't think so, since this is executed as `((i1 + i2) + s1)`. Mark's carets look correct to me, since the second (outer) addition's LHS is the result of adding `i1` and `i2`: ``` Python 3.11.0a0 (heads/main:a42d98ed91, May 16 2021, 14:02:36) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import ast op = ast.parse("i1 + i2 + s1", mode="eval").body op <ast.BinOp object at 0x7fa23d368910> op.col_offset 0 op.end_col_offset 12
Brandt