Terry J. Reedy added the comment:
I am closing because 2 of your 3 examples (and many others) have had the
messages changed in an effort to be more informative. But Pablo can reverse
this if he wants.
In 3.10:
>>> * 2
SyntaxError: can't use starred expression here
+2 and -2 are also valid
Batuhan added the comment:
I am not sure about how to implement this to the core, but you can combine
tokenize with ast to reproduce this kind of messages in your projects. You can
match tokens with SyntaxErrors by lineno and offset.
--
nosy: +BTaskaya
__
Terry J. Reedy added the comment:
Currently,
>>> * 2 # or * a
SyntaxError: can use starred expression only as assignment target
This conflicts with your desired message. It cannot change because *a, at
least, is a valid statement prefix in a way that '/ a' is not.
Most other things give an unin
New submission from alon horev:
Some context for this feature request:
I'm using the wonderful ast module for a library that translates python code to
MongoDB queries (https://github.com/alonho/pql). I also did the same for SQL
queries using sqlalchemy as a part of another project
(https://git