What's up with rebinding assignment?

Greg Ewing (using news.cis.dfn.de) me at privacy.net
Mon Mar 24 06:21:26 CET 2003


Des Small wrote:
> def bind():
>     x = 1
>     def rebind():
>         lexical x
>         x = 2
>     rebind()
>     print x

This looks a lot neater to me than adding a new assignment
operator.

But I would call it "outer" rather than "lexical".

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg





More information about the Python-list mailing list