4 ms·
Those are closures (btw, did you mean generators instead of decorators?). Until nonlocal (https://www.python.org/dev/peps/pep-3104/ https://www.python.org/dev/p
by junke 11y ago
Those are closures (btw, did you mean generators instead of decorators?). Until nonlocal (https://www.python.org/dev/peps/pep-3104/ https://www.python.org/dev/peps/pep-3104/), python closures were limited (http://stackoverflow.com/questions/141642/what-limitations-have-closures-in-python-compared-to-language-x-closures http://stackoverflow.com/questions/141642/what-limitations-h...). Even though nonlocal solves the problems, the resulting scoping rules are messy: global, local, nonlocal, ...