[Python-Dev] Another Anonymous Block Proposal
Josiah Carlson
jcarlson at uci.edu
Wed Apr 27 18:25:13 CEST 2005
Jason Diamond <jason at diamond.name> wrote:
>
> Paul Svensson wrote:
>
> > You're not mentioning scopes of local variables, which seems to be
> > the issue where most of the previous proposals lose their balance
> > between hairy and pointless...
>
> My syntax is just sugar for nested defs. I assumed the scopes of local
> variables would be identical when using either syntax.
>
> Do you have any pointers to that go into the issues I'm probably missing?
We already have nested defs in Python, no need for a new syntax there.
The trick is that people would like to be able to execute the body of a
def (or at least portions) in the namespace of where it is lexically
defined (seemingly making block syntaxes less appealing), and even some
who want to execute the body of the def in the namespace where the
function is evaluated (which has been discussed as being almost not
possible, if not entirely impossible).
- Josiah
More information about the Python-Dev
mailing list