[Tutor] Thoughts on little lambda

alan.gauld@bt.com alan.gauld@bt.com
Sat, 9 Mar 2002 21:42:13 -0000


> I tried this particular excersise and had a problem...
> 
> ------------------------------------------------------
> Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit 
> ....
> SyntaxError: local name 'n' in 'addn' shadows use of 'n' as 
> ...
> Am I missing something?

Yes, Python 2.2

In 2.1 you need to do 

from __future__ import nested_scopes

or something similarly arcane.

Alan G