[Python-Dev] anonymous blocks
python-dev at zesty.ca
Fri Apr 22 01:49:36 CEST 2005
On Thu, 21 Apr 2005, Guido van Rossum wrote:
> Perhaps it could be even simpler:
> [assignment_target '=']* expr ':' suite
> This would just be an extension of the regular assignment statement.
It sounds like you are very close to simply translating
If i understand what you proposed above, you're using assignment
as a special case to pass arguments to the inner suite, right? So:
inner_args = function_call(outer_args):
This could get a little hard to understand if the right-hand side
of the assignment is more complex than a single function call.
I think the meaning would be unambiguous, just non-obvious. The
only interpretation i see for this:
x = spam('foo') + eggs('bar'):
spam('foo') + eggs('bar')(suitefunc)
but that could seem a little too mysterious. Or you could (in a
later compiler pass) forbid more complex expressions on the RHS.
On another note, would there be any difference between
x = spam():
x = spam:
More information about the Python-Dev