Hacker News new | past | comments | ask | show | jobs | submit login

Python's closures are basically read-only in the 2.x series. 3.0 will offer read-write access via the nonlocal keyword: http://www.python.org/dev/peps/pep-3104/

It still won't be exactly the same, because Perl uses `my $foo` once to declare its lexicals; Python will require `nonlocal foo` declarations in all scopes that will use `foo`. The final result is the same, though: using variables from outer scopes.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: