Are there any rules or recommendations regarding using relative imports in Python? I see them in use all the time, like in a flash framework. When searching for this topic, I see only articles on how to use relative imports, but not why.
So there is a particular benefit of using:
from . import x
but not:
from package import x
In addition, I noticed that in the question this SO, the answer mentions that relative imports are not encouraged. But people still continue to use them.
python import module package
trinth Oct 05 2018-12-12T00: 00Z
source share