Created
October 2, 2018 16:26
-
-
Save raymondberg/7058f3e1b76b98434906609892eb0136 to your computer and use it in GitHub Desktop.
Explaining module imports in python
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
| - bin | |
| - theirmod | |
| - __init__.py/ | |
| - mymod/ | |
| - __init__.py | |
| - more/ | |
| - __init__.py | |
| - other.py | |
| - magic.py | |
| - new_mod/ | |
| - __init__.py -> 'from .two import Blah' | |
| - two.py | |
| import mymod #yes | |
| import theirmod #yes | |
| import magic #no | |
| import bin #no | |
| import mymod.magic #yes | |
| import mymod.more #no | |
| import mymod.more.other #no | |
| import new_mod | |
| from new_mod import Blah | |
| from new_mod.two import Blah | |
| import new_mod.two | |
| import [module] | |
| from [module] import [object] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment