Created
January 3, 2018 17:46
-
-
Save avindra/93a079f486c6328960a8f5d22e4ae538 to your computer and use it in GitHub Desktop.
Proof of python lacking lexical scope
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
#!/usr/bin/env python3 | |
if True: | |
a = " am i lexically scoped?" | |
print(a) | |
print("exiting") | |
exit(0) | |
# imports can be used before they are | |
# defined | |
from sys import exit | |
from json import dumps | |
print("should never happen") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment