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
  • 124,992
  • 159
  • 614
  • 958
  • 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
  • 152,115
  • 15
  • 115
  • 172