We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
对应的代码片段为:
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir)
以 aliyunsdkcore/http/http_request.py 为例:
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir) import format_type
作者的目的是 import format_type module, 那么通过 from aliyunsdkcore.http import format_type 这种绝对引用方式, 或者 from . import format_type 都能办到。 作者却选择了将 这个目录添加到了 sys.path 的最前面这种不正确的方式。
from aliyunsdkcore.http import format_type
from . import format_type
如果使用者自己代码里含有和 aliyunsdkcore.http 同名的文件, 将导致无法正确 import. 而 ·aliyunsdkcore/` module 下就有utils 这种非常常见的 module 名
The text was updated successfully, but these errors were encountered:
遇到同样的问题
Sorry, something went wrong.
@glasslion @wangrenqi 感谢您的热心反馈,这块的确是我们需要改进的地方 我们会尽快对代码进行一次清洗,彻底消除这种代码 再次感谢,对您带来的不便十分抱歉
@glasslion @wangrenqi 代码已经清洗了,再次感谢您的反馈
gaort
No branches or pull requests
对应的代码片段为:
以 aliyunsdkcore/http/http_request.py 为例:
作者的目的是 import format_type module, 那么通过
from aliyunsdkcore.http import format_type
这种绝对引用方式, 或者from . import format_type
都能办到。 作者却选择了将 这个目录添加到了 sys.path 的最前面这种不正确的方式。如果使用者自己代码里含有和 aliyunsdkcore.http 同名的文件, 将导致无法正确 import. 而
·aliyunsdkcore/` module 下就有utils 这种非常常见的 module 名
The text was updated successfully, but these errors were encountered: