Guido van Rossum wrote:

> Hallo broer! :-)

Yo :)

> I wonder what this should mean then:
> 
> def outer():
>   def inner():
>     x := 1
>
> What is x's scope?

UnboundVariableError: variable 'x' referenced before assignment

Or a SyntaxError if the compiler can detect it.

> Also, a := operator allows all sorts of left-hand sides that don't
> necessarily make sense, e.g.
> 
> x.foo := 1
> x[0] := 1

True, although maybe they could be made to make sense by defining
special methods:

    __rebindattr__
    __rebinditem__

<0.5 wink>

Just
_______________________________________________
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