0

I'm currently going over a medium-sized code base. In some cases, other modules are imported with a relative path:

from .api.auth import jwt_load_user

and sometimes absolutely

from app.api.auth import jwt_load_user

Is there any difference? Is it just personal taste which style to choose?

Martin Thoma
  • 108,021
  • 142
  • 552
  • 849
  • There is some good answers to Absolute vs relative [here](https://stackoverflow.com/q/4209641/7942856). Pep-8 also touches on this, suggesting absolute imports are recommended. – PacketLoss Sep 10 '20 at 07:36

1 Answers1

0

To the best of my knowledge, it's just a matter of personal taste and codebase style (unless there's some forbidden, evil sys.path/loader meta magic in use).

AKX
  • 123,782
  • 12
  • 99
  • 138