Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created September 22, 2010 00:30
Show Gist options
  • Save ingydotnet/590870 to your computer and use it in GitHub Desktop.
Save ingydotnet/590870 to your computer and use it in GitHub Desktop.
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