Martin v. Löwis wrote: > That's not the full syntax. The full syntax is > > [ <test> for <exprlist> in <testlist> <list-iter-opt> ] > > where > > <test> can be an arbitrary expression: and, or, lambda, +, -, ... > <exprlist> can be a list of expression, except for boolean and > relational expressions (but I think this is further constrained > semantically) > <testlist> list a list of tests > <list-iter-opt> is optional, and can be another for or if block Aren't these names a bit mixed up w.r.t. what's in that position? As far as I know <test> is not a test but a function as it produces any value not just True/False <exprlst> is a list of names, not arbitrary expressions <testlist> is anything which will produce an iterator Or so I've understood so far. > So a more complex example is > > [ lambda a: a[x]+y*z for x,y in A for z in B if x > z] I'm schocked ;-) --eric
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4