Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, this is like closures or decorators in python.


Those are closures (btw, did you mean generators instead of decorators?). Until nonlocal (https://www.python.org/dev/peps/pep-3104/), python closures were limited (http://stackoverflow.com/questions/141642/what-limitations-h...). Even though nonlocal solves the problems, the resulting scoping rules are messy: global, local, nonlocal, ...




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

Search: