(An Unofficial) Python Reference Wiki

"clearly marked experimental"

5c34

The last syntax line is incorrect. The first item must be a for, but the rest can be either for or if. E.g.

[a for b in c if d in e for f in g]

is syntactically correct (if not very meaningful, of course).