[issue19080] Enrich SyntaxError with additional information

2021-04-02 Thread Terry J. Reedy
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

[issue19080] Enrich SyntaxError with additional information

2019-11-18 Thread Batuhan
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 __

[issue19080] Enrich SyntaxError with additional information

2013-09-28 Thread Terry J. Reedy
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

[issue19080] Enrich SyntaxError with additional information

2013-09-23 Thread alon horev
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