Skip to content

Instantly share code, notes, and snippets.

@baojie
Created December 17, 2014 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baojie/83c62a0a8145d849cc86 to your computer and use it in GitHub Desktop.
Save baojie/83c62a0a8145d849cc86 to your computer and use it in GitHub Desktop.
Test whether statements in a module will just run once under multiple imports
print "run a from", __file__
import a
import a
import b
import a
@baojie
Copy link
Author

baojie commented Dec 17, 2014

$ python c.py
run a from /tmp/test/a.pyc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment