Skip to content

Instantly share code, notes, and snippets.

@trehn
Created May 6, 2011 13:17
Show Gist options
  • Save trehn/958938 to your computer and use it in GitHub Desktop.
Save trehn/958938 to your computer and use it in GitHub Desktop.
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
>>> unicode
<type 'unicode'>
>>> def test():
... if type("x") == unicode:
... print "the if above fails only if the next two lines are present"
... if False:
... unicode = 23
...
>>> test()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in test
UnboundLocalError: local variable 'unicode' referenced before assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment