A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039572.html below:

[Python-Dev] replacing 'global'

[Python-Dev] replacing 'global' [Python-Dev] replacing 'global'Alex Martelli aleaxit at yahoo.com
Sun Oct 26 11:20:16 EST 2003
On Sunday 26 October 2003 04:58 pm, Just van Rossum wrote:
> Aahz wrote:
> > Sounds good to me.  Question: what does this do?
> >
> >     def f():
> >         def g(x):
> >             z := x
> >         g(3)
> >         print z
> >         return g
> >     g = f()
> >     print z
> >     g('foo')
> >     print z
> >
> > That is, in the absence of a pre-existing binding, where does the
> > binding for := go?  I think it should be equivalent to global, going
> > to the module scope.
>
> I think it should raise NameError or UnboundLocalError or a new
> NameError subclass. "In the face of ambiguity, etc."

Absolute agreement here.  I think a new subclass of NameError
would be best.  The simplest and most limited the functionality of
:= the more effective I think it will be.


Alex


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4