> What do you mean? > > for x in lambda: ...: > ... > > Perfectly grammatical.
1. You put the lambda definition in the wrong place (it should be in the left-hand side, or as Python calls it "star_targets", but you put it into "star_expressions", which would be where the right-hand side is drawn from). 2. You used what Python calls "lambdadef" in place of what Python calls "function_def". I.e. lambda definition and function definition are two different things, at least as far as grammar is considered. So, you solved a different problem. -- https://mail.python.org/mailman/listinfo/python-list