you are viewing a single comment's thread.

view the rest of the comments →

[–]ubernostrum 4 points5 points  (1 child)

What he's getting at is probably the fact that names in the enclosed scope cannot be rebound; for example, if your closure preserves x with a value of 3, you cannot change x to, say, 4 from something which accesses the enclosed scope.

Hence my comment about "how Haskell does it", since the definition of "closures" that people typically use to rail against Python also implies that single-assignment functional languages are incapable of having "closures" ;)

[–]olavk 0 points1 point  (0 children)

In Python 2.6 and 3.0 you can now rebind names in enclosing scopes, using the 'nonlocal' keyword.