2 ms·
Explicit relative imports use a "." to indicate the file/package is from the current directory and not found elsewhere in sys.path: from . import foo from
by Izkata 5y ago
Explicit relative imports use a "." to indicate the file/package is from the current directory and not found elsewhere in sys.path:
from . import foo
from .foo import bar
Implicit relative imports don't have such an indicator:
from foo import bar
In py2, that second one could be a relative import or from anywhere in sys.path, while in py3 those implicit relative imports were removed so that means it'll only only look in sys.path and not the local directory.
https://stackoverflow.com/questions/48716943/what-is-python-implicit-relative-import https://stackoverflow.com/questions/48716943/what-is-python-...