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/039740.html below:

[Python-Dev] replacing 'global'

[Python-Dev] replacing 'global' [Python-Dev] replacing 'global'Samuele Pedroni pedronis at bluewin.ch
Tue Oct 28 16:55:34 EST 2003
At 07:27 28.10.2003 -0800, Guido van Rossum wrote:
>   It matches what the current global statement does, and it
>makes it crystal clear that you *can* declare a variable in a specific
>scope and assign to it without requiring there to be a binding for
>that variable in the scope itself.  EIBTI when comparing these two.

looking at:

x = 'global'

def f():
   def init():
     global x in f
     x = 'in f'
   def g():
     print x
   init()
   g()

I don't really know whether to call explicit or implicit the fact that x in g
is not the global one. And contrast with

x = 'global'

def f():
   x = 0
   def init():
     global x
     x = 'in f'
   def g():
     print x
   init()
   g()

or consider

x = 'global'

def f():
   global x
   def init():
     global x in f
     x = 'in f'
   def g():
     print x
   init()
   g()



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