Created
November 11, 2018 21:35
-
-
Save mpdehaan/f8c85b0af733598f1d3d36ca09128ce5 to your computer and use it in GitHub Desktop.
python 3 import magic
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
# is there a better way to write all the code in magic_imports.py to re-surface a lot of deeply nested | |
# symbols at the top level? | |
# ====== | |
# magic_imports.py | |
# this is just an example but there could be 20 different classes here | |
# the purpose is to import all the symbols so any file that uses them doesn't have to deal with the full path | |
from long.stupid.path import Glorp as _Glorp | |
from long.other.stupid.path import Blarg as _Blarg | |
# ... | |
Glorp = _Glorp | |
Blarg = _Blarg | |
# ... | |
# ======= | |
# other.py | |
from magic_imports import * | |
Glorp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this doesn't work...but is maybe close-ish