News for hackers. Stuff that matters.
Re:Just why did people start using Python anyway? by eru on Thursday October 09, 2008 @10:33AM (#327840)
You may need to add a 'global' statement or something similiar. If you are going to mutate a variable in a function Python assumes that you want to create a new variable in that scope.

Generally I do not mutate variables as far as possible, so I have not hit this problem myself, yet. Perhaps there is someone more knowledgeable about Python to step in.

Re:Just why did people start using Python anyway? by silentbicycle on Thursday October 09, 2008 @10:39AM (#327853)
But it's not a global variable, it's scoped within the closure. So, this means Python doesn't have lexical scoping?
Re:Just why did people start using Python anyway? by eru on Thursday October 09, 2008 @11:26AM (#327898)
It has. Just the syntax was a bit awkward when modifying variables of higher scope. See sibling comment.