Created
September 21, 2011 01:37
-
-
Save ErinCall/1230967 to your computer and use it in GitHub Desktop.
ok so this probably isn't what I should be doing, but it definitely isn't what python should be doing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def foo(bar=None): | |
... def baz(): | |
... if not bar: bar = 'goo' | |
... print bar | |
... baz() | |
... | |
>>> foo() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "<stdin>", line 5, in foo | |
File "<stdin>", line 3, in baz | |
UnboundLocalError: local variable 'bar' referenced before assignment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment