Created
September 22, 2010 00:30
-
-
Save ingydotnet/590870 to your computer and use it in GitHub Desktop.
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
Note that you don’t have to use from-import to get into trouble: | |
# module Y | |
import X | |
X.spam() # doesn't work either: spam isn't defined yet! | |
To fix this, either refactor your program to avoid circular imports (moving stuff to a separate module often helps), or move the imports to the end of the module (in this case, if you move import Y to the end of module X, everything will work just fine). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment