Created
July 8, 2017 14:49
-
-
Save geekKeen/d6bb9e2c181bd7fd06a3065ade46bcd8 to your computer and use it in GitHub Desktop.
Python absolute import
This file contains 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
``` | |
file sqlalchemy/orm/mapper.py | |
``` | |
from __future__ import absoute_import | |
from collections import deque |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
file system
sqlalchemy/
...
orm/
init.py
mapper.py
...
在 mapper.py 中导入 collections 将会出现模糊,
是导入项目中的还是Python 标准库,
此时用 future 模块将会使用绝对导入,会从sys中选择