Message24741
Logged In: YES
user_id=1038590
The problem is definitely on the parser end though:
Py> compiler.parse("foo(x=i for i in range(10))")
Module(None, Stmt([Discard(CallFunc(Name('foo'),
[Keyword('x', Name('i'))], None, None))]))
It's getting to what looks like a valid keyword argument in
"x=i" and throwing the rest of it away, when it should be
flagging a syntax error (the parser's limited lookahead
should be enough to spot the erroneous 'for' keyword and
bail out).
The problem's actually worse than the OP noted: consider
what will happen if there is a variable "i" visible from the
location of the function call (e.g. from a list
comprehension or for loop in a nested scope). Good luck
tracking that one down. . .
|
|
Date |
User |
Action |
Args |
2007-08-23 14:30:27 | admin | link | issue1167751 messages |
2007-08-23 14:30:27 | admin | create | |
|