Last active
June 2, 2020 13:50
-
-
Save timmc-edx/29b42059dae89348d7ea570ac3a0cdde to your computer and use it in GitHub Desktop.
terrible scope example in python
This file contains hidden or 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
# python3 ./first.py | |
import second | |
import builtins | |
builtins.magic = "wow" | |
second.some_func() |
This file contains hidden or 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 some_func(): | |
print(magic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment