Lysandros Nikolaou <[email protected]> added the comment:
> But if the col_offset points way past the text, what should happen? The
> clipping there seems reasonable.
Note that if a file is being parsed and not a string the behaviour is this:
╰─ cat -e t.py
x = 1 | 2 | $
╰─ ./python.exe t.py
File "/Users/lysnikolaou/repos/cpython/t.py", line 1
x = 1 | 2 |
^
SyntaxError: invalid syntax
╰─ ./python.exe -X oldparser t.py
File "/Users/lysnikolaou/repos/cpython/t.py", line 1
x = 1 | 2 |
^
SyntaxError: invalid syntax
Would we want to also change this? If not, then I guess that we should as
closely as possible match this behaviour with strings as well, which means not
clipping.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40546>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com