This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lazka
Recipients lazka
Date 2020-12-05.15:10:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I don't know if the bug tracker is the right place for this, please point me to the right place if not.

Someone faced to the following code (simplified example here) and asked for help:

if 3:
    if 1:

if 2:

This results in the following error:

File "", line 5
  if 2:
SyntaxError: invalid syntax

which is very confusing to users not familiar with generator expressions.

I'm wondering if python could improve syntax errors in this case by adding more context, like point to where it started parsing the current thing and where it gave up instead to just the later.
Date User Action Args
2020-12-05 15:10:38lazkasetrecipients: + lazka
2020-12-05 15:10:38lazkasetmessageid: <>
2020-12-05 15:10:38lazkalinkissue42577 messages
2020-12-05 15:10:38lazkacreate