Re:Functional Programming in Python [pdf]
by rectangletangle on Friday July 24, 2015 @10:00PM
(#9946256)
Seems like a comprehension is just a particular form of Python expression.
Re:Functional Programming in Python [pdf]
by aaronchall on Saturday July 25, 2015 @01:26AM
(#9946659)
Here's the grammar file: https://docs.python.org/2/reference/grammar.html
Look for dictorsetmaker (for {}) testlist_comp (for generator expressions) and listmaker (for [], i.e. list comprehensions).
Here's how you make those set/dict whatever comprehensions in Python 2.6, before the native syntax is used: