On 2/22/06, Almann T. Goo <[EMAIL PROTECTED]> wrote:
> Since the current semantics allow *evaluation* to an enclosing scope's
> name by an "un-punctuated" name, "var" is a synonym to ".var" (if
> "var" is bound in the immediately enclosing scope).  However for
> *re-binding* to an enclosing scope's name, the "punctuated" name is
> the only one we can use, so the semantic becomes more cluttered.
>
> This can make a problem that I would say is akin to the "dangling else 
> problem."
>
>     def incrementer_getter(val):
>        def incrementer():
>            val = 5
>            def inc():
>                ..val += 1
>                return val
>            return inc
>        return incrementer
>
> Building on an example that Steve wrote to demonstrate the syntax
> proposed, you can see that if a user inadvertently uses the enclosing
> scope for the return instead of what would presumably be the outer
> most bound parameter.  Now remove the binding in the incrementer
> function and it works the way the user probably thought.

Sorry, what way did the user think?  I'm not sure what you think was
supposed to happen.

STeVe
--
Grammar am for people who can't think for myself.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to