DEV - Code: Relative imports. #1159
real-yfprojects
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I intentionally use absolute imports unless it's the same package. This is also what's suggested in theofficial docs.
I also find absolute imports easier to find and update, if a package is renamed. Still appreciate the effort and concern to improve something, but changing We have more urgent issues open. Especially those marked Good first issue are there to get started and get to know the code. Thanks and happy new year! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking at the code of vorta and noticed that absolute imports instead of relative imports are used for importing other modules of the
vorta
package. Is there a reason for that?I could create a PR converting all the package-internal imports to relative ones.
Example 1
vorta/src/vorta/__main__.py
Line 12 in eadb3e7
would be changed to
Example 2
vorta/src/vorta/borg/check.py
Line 1 in eadb3e7
Already in place 🤷
Example 3
vorta/src/vorta/borg/prune.py
Line 2 in eadb3e7
would be converted to
Beta Was this translation helpful? Give feedback.
All reactions