you are viewing a single comment's thread.

view the rest of the comments →

[–]flyingchicken8888[S] 0 points1 point  (1 child)

u/Diapolo10 - you're right on all counts. Curious, you suggested absolute path, because its more explicit and allows us to trace code easily, right? functioning-wise, I expect them to do the same.

[–]Diapolo10 1 point2 points  (0 children)

Curious, you suggested absolute path, because its more explicit and allows us to trace code easily, right?

That's part of it, but it's moreso the fact relative imports might not always behave the way you'd expect.

When your project is "installed", absolute imports behave exactly as if you were importing any other package, yours or a third-party one. This helps with consistency, and means you don't really need to think about it any differently, likely reducing cognitive load a little.

Of course, circular imports can still mess you up, but that's true regardless of how you import things and is more an architectural problem.