News for hackers. Stuff that matters.
Re:Pattern matching accepted for Python by _nosewings_ on Tuesday February 09, 2021 @07:34PM (#26084454)
The explanation is that (in Python 3) list comprehensions are really just syntactic sugar for generator expressions. In Python, "scope" is really a synonym for "dictionary attached to some object", so generators can have local variables (since they have their own internal scope), but purely syntactic constructs cannot.

There are no comments on this comment yet.