[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I will close this but will try to think for another issue into an error for the parens -> braket. Thanks for opening the issue! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Pyt

[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Andre Roberge
Andre Roberge added the comment: I understand. I reported this issue when one of my newest tests failed with Python 3.10 and 3.11. Actually, using friendly-traceback, using the location of the exception as indicated by cPython 3.10 and 3.11, here's part of the explanation it gives: The

[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think this is correct because if you add a comma, indeed is valid syntax: >>> sum,[i for i in [1, 2, 3] if i%2==0] (, [2]) Here the problem is that you are mentally mapping the construct to sum(...) where the parens are substituted with brackets, wh

[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Andre Roberge
New submission from Andre Roberge : Python 3.10 and 3.11: >>> sum[i for i in [1, 2, 3] if i%2==0] File "", line 1 sum[i for i in [1, 2, 3] if i%2==0] ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? Furthermore, I don't find that highlighti