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

[Python-Dev] 2.5 and beyond

[Python-Dev] 2.5 and beyondJosiah Carlson jcarlson at uci.edu
Tue Jul 4 02:20:28 CEST 2006
"Bill Chiles" <billchi at microsoft.com> wrote:
> 
> For Common Lispers and probably Schemers, Python has some surprising
> semantics around scope and lifetime extent of variables.  Three that
> leap out at me are:

One thing to remember is that Python is not Scheme/Lisp.  It borrows
some ideas from Scheme/Lisp, but that borrowing does not necessitate a
it also use a completely equivalent scoping mechanism.  From what I have
been hearing about Python 2.6, and 3.0, the three "surprises" you
describe are not going to be "fixed" (with respect to expected
Scheme/Lisp semantics).

Feel free to argue as to why they should be "fixed" in Py3k (unless
Guido says, "you're dreaming"), but please do so in the py3k list.

 - Josiah


>  * function parameters with default values are NOT new bindings for each
> invocation, so a
>    default value of [] changes if you destructively modify this list
> object in the function
>  * loop variables are NOT distinct lexical variables.  The binding gloms
> on to a variable in the
>    function's scope, both changing that lexical binding and not creating
> a new one for the
>    loop (that goes away when the loop's scope ends)
>  * loop variables are NOT distinct bindings per iteration, leading to
> the surprising results
>    below

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