News for hackers. Stuff that matters.
Re:Crystal: the programming language by exogen on Tuesday November 25, 2014 @02:52PM (#8659361)
"Just fine" is papering over the fact that people get tripped up by this in Python all the time – sometimes you need to use the `global` or `nonlocal` statements to resolve the ambiguity.

https://docs.python.org/3/reference/simple_stmts.html#global

https://docs.python.org/3/reference/simple_stmts.html#nonloc...

Classic example: http://stackoverflow.com/questions/9264763/unboundlocalerror...

If you search for UnboundLocalError on StackOverflow, there are 918 results. Not all of them are due to this particular scoping ambiguity, but many of them are.

There are no comments on this comment yet.