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
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/YCMHFU4I7TEYDQP7OH4AX2YOD4KPLNFX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to