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/2006-July/066872.html below:

[Python-Dev] 2.5 and beyond

[Python-Dev] 2.5 and beyond [Python-Dev] 2.5 and beyondKa-Ping Yee python-dev at zesty.ca
Sat Jul 1 01:55:12 CEST 2006
On Fri, 30 Jun 2006, Andrew Koenig wrote:
> The fundamental principle is that the binding of every name is determined
> during compilation, not during execution.  This property does not quite
> apply to Python at present.

I think this property does apply.  In your example:

> 	def g():
> 		return x
> 	x = 42
> 	g()
>
> the result is 42.

It is already known at compile time that the "return x" in g()
refers to an 'x' in the outer scope.  'x' cannot be a local variable
to g() because there are no statements in g() that bind 'x'.

Regardless of whether the binding itself exists yet, you (the reader)
and the compiler can know which scope to look in for the binding at
runtime.  Have i understood your desired property correctly?


-- ?!ng
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