0

While importing modules in python does it make a difference if we put a "." infront of the module name and does it have an advantage ?

Example in django docs :

from .models import Question

Is it different than

from models import Question

that one ?

ZE0TRON
  • 94
  • 6

1 Answers1

0

Yep, without the . you mean absolute import in "modern" Python version, and you have relative with the . You can read here PEP 328 -- Imports: Multi-Line and Absolute/Relative for more details.