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 mark.dickinson
Recipients david2, mark.dickinson
Date 2021-11-22.08:48:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
True: there's another detail here that's needed to explain the behaviour. The first "for" clause in a list comprehension is special: it's evaluated in the enclosing scope, rather than in the local function scope that the list comprehension creates. See the docs here: https://docs.python.org/3.9/reference/expressions.html?highlight=list%20comprehension#displays-for-lists-sets-and-dictionaries
History
Date User Action Args
2021-11-22 08:48:17mark.dickinsonsetrecipients: + mark.dickinson, david2
2021-11-22 08:48:17mark.dickinsonsetmessageid: <[email protected]>
2021-11-22 08:48:17mark.dickinsonlinkissue45862 messages
2021-11-22 08:48:17mark.dickinsoncreate