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 chrisgmorton
Recipients chrisgmorton, terry.reedy
Date 2021-03-24.15:20:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616599211.17.0.194415792863.issue43481@roundup.psfhosted.org>
In-reply-to
Content
Is this change in behavior considered to be by design or is this issue an unintended consequence? It seems inconsistent that comprehensions have no visibility of variable previously defined in the same scoping for this particular use-case. Is there a way to work around this other than reworking the comprehension?

It seems odd that [ci for ci in c] does not produce the error but [c for i in [1]] does produce the error.
History
Date User Action Args
2021-03-24 15:20:11chrisgmortonsetrecipients: + chrisgmorton, terry.reedy
2021-03-24 15:20:11chrisgmortonsetmessageid: <1616599211.17.0.194415792863.issue43481@roundup.psfhosted.org>
2021-03-24 15:20:11chrisgmortonlinkissue43481 messages
2021-03-24 15:20:11chrisgmortoncreate