Semantics --------- The code::
<statement> with: <suite>
translates to::
def unique_name(): <suite> <statement> unique_name()
Bleh. Not only was my proposed grammar change wrong, my suggested semantics are wrong, too.
Raise your hand if you can see the problem with applying the above semantics to the property descriptor example.
So I think the semantics will need to be more along the lines of "pollute the namespace but mangle the names so they're unique, and the programmer can *act* like the names are statement local".
This will be much nicer in terms of run-time performance, but getting the locals() builtin to behave sensibly may be a challenge.
afair you told yourself that
var = <statement> where: <suite>
translates to:
def unique_name(): <suite> return <statement> var = unique_name()
in this case class gets unique_name() function? is it that bad?
anyway I'd prefer to change semantics deeper. adding new statement-only scope and adding our suite-definitions there.
--
http://mail.python.org/mailman/listinfo/python-list