Skip to content

Instantly share code, notes, and snippets.

@weissjeffm
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weissjeffm/9837160 to your computer and use it in GitHub Desktop.
Save weissjeffm/9837160 to your computer and use it in GitHub Desktop.
huh.py
x=1
def foo(y):
x += 1
return x + y
foo(2)
Truncated Traceback (Use C-c C-x to view full TB):
<ipython-input-24-807bbe2ba12a> in foo(y)
1 x=1
2 def foo(y):
----> 3 x += 1
4 return x + y
5 foo(2)
UnboundLocalError: local variable 'x' referenced before assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment