Hacker News new | ask | show | jobs
by Jach 5433 days ago
One might argue you shouldn't mix functional programming with side effects. ;P

But it's not so much the case of scoping as the case of variable binding. Assignments/statements in Python don't work like they do in some other languages. So your inner function can reference the outer "x" all it wants, but you'll get problems if you try to do something like x += 1.