"Andrew McNamara" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >Guido wrote:
>>> My personal preference is still to abuse 'global' instead of adding a
>>> new, ugly keyword. That would make the syntax for global and nonlocal
>>> completely identical. :-) But I seem to be alone in this preference.
No, I (and others, it seems) just never have reason before to clutter the
list with a 'me-too' post.
> But it doesn't mean "top-level" - it already comes with the qualifier
> "module". Even after nearly a decade of python use, I still find that
> slightly unnatural,
Me too ;-)
> and changing "global" to mean "enclosing scope"
> feels only slightly more unnatural.
Me too ;-)
Actually, I would only want a separate keyword would be if one wanted to be
able to write
x = 1
def f():
x = 'a'
def _f():
global x = {}
and have that act differently (as at present) from the inside-out behaviour
of
newkey x = 'whatever'. But I will not write such code and do not want to
see such.
With two different but similar keywords, I would expect to see requests to
be able to write
def _f():
global x = 2
print x
nonlocal x = 'b'
print x
Terry Jan Reedy
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com