(一)“from module import *” 警告
一般不建议使用from module import * ,最好是导入相对应的函数即可!
如果出现警告unable to detect undefined names,解决办法:
Your IDE is complaining, not Python. When you do from simple import *, you import everything exposed by simple. This is typically not recommended because it pollutes the global namespace and may implicitly overwrite an existing object.
You get a warning instead of an error because this behavior is not always bad. Having an init.py file that exposes objects from sub-modules is a very common pattern. As long as you understand the potential risks, just silence the warning:
不推荐
from .input import * # NOQA