Lambda added to release 2.2 ?

Chris Liechti cliechti at gmx.net
Sun Apr 14 13:04:28 EDT 2002


Fabien Hénon <ffjhenon at club-internet.fr> wrote in 
news:3CB9ABAB.E37E685B at club-internet.fr:
> When I start my python script, here is what I get on the console from
> Linux (Python 2.1) :
> a26.py:51: SyntaxWarning: local name 'self' in '__init__' shadows use of
> 'self' as global in nested scope 'lambda'
>   def __init__(self, master):
...
> I don't have any problem under W2000 ( Python 2.2)
> Is lambda function a new add-on to 2.2 ? 

no but, nested scopes are now enabled by default wheras in
2.1 you need to write
>>> from __future__ imort nested_scope
and the warning will go away.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list