-
-
Save andrewcstewart/5558654 to your computer and use it in GitHub Desktop.
How is b.D() smart enough to know that C is b.C(), or rather how is it aware of C when C hasn't been imported into the environment?
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
import B as b | |
b.D() |
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
C = "foo" | |
def D(): | |
print C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/291978/short-description-of-python-scoping-rules