[Python-Dev] Explicit Lexical Scoping (pre-PEP?)

Almann T. Goo almann.goo at gmail.com
Thu Jul 6 17:49:16 CEST 2006


On 7/6/06, Guido van Rossum <guido at python.org> wrote:
>
> +1 on nonlocal.
>
> I think that the := operator is also in case (b), but as I don't like
> it I'm find with not mentioning it. :-)
>
> Could someone write a PEP for this? Doesn't have to be very long but
> I'd like it to summarize the main options proposed and discuss them,
> like I did for the switch PEP. It's a p3yk PEP. (We really need to
> move this to the py3k list...)
>

Drat, too bad this wasn't back in February when I was all for writing the
PEP--sadly, I don't have time to do this, maybe later if no one steps up to
the plate...

For reference, here is a link to the other, rather large, thread on this
back then:
http://thread.gmane.org/gmane.comp.python.devel/76532/focus=76532

My option one, is essentially "nonlocal", though I spelled it as "use".
Really, I am personally agreeable to almost any spelling of such a keyword.
I am +1 on "nonlocal", though I know the biggest dissent against it is
adding another "global"-like keyword that is not "pythonic".

Also in regard to the "prefix-dot" notation (i.e. ".x"), I am -1 for the
reason that it introduces a subtle alternate way of spelling local
variables.  The rules for the usage would have to be strict enough to
prevent subtle code obscurity (like what is the semantics for using ".x" and
"x" in a scope--are both spellings allowed, and if so, what is the meaning
if assignment is involved or is not involved).  Of course, if the semantics
were well defined such that it would be difficult for users to trap
themselves with different spellings of local variables, then I would be +0
for it.

Best Regards,
Almann

-- 
Almann T. Goo
almann.goo at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20060706/db27bf8e/attachment.htm 


More information about the Python-Dev mailing list