RFC: Relative Imports vs Absolute Imports #3525
Replies: 7 comments 1 reply
|
My preference is always for absolute imports, as they make the code clear to read. I understand that relative imports can help in the development process while setting up a development environment, but, if possible, I would go with absolute imports. In case it is not a pain and do not breaks what we have now, I agree with removing the relative imports. |
|
+1 for absolute imports between sub-packages, nor +1 or -1 for absolute imports between modules of the same sub-package, as the use cases for relative imports there are stronger. |
|
@apahim can you elaborate on the "relative imports there are stronger", please? |
|
https://www.python.org/dev/peps/pep-0328/#rationale-for-relative-imports |
|
But as I said, nor +1 or -1. If you change it, awesome, if you don't, fine :) |
|
Haa ok, thanks! |
|
@clebergnu are you ok with moving from relative to absolute ? I would like to remove the |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I noticed that we have some selftests that checks for absolute imports on core (
selftests/modules-boundaries.sh).From PEP8:
I just would like to know what you think about that. What do you prefer and why?
Does anyone have any strong objections to removing relative imports?
All reactions