[Python-Dev] Why does PEP 8 advise against explicit relative imports? (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Tue Jul 16 13:40:00 CEST 2013
- Previous message: [Python-Dev] [Python-checkins] cpython (3.3): check the return value of new_string() (closes #18470)
- Next message: [Python-Dev] Why does PEP 8 advise against explicit relative imports?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
PEP 8 advises developers to use absolute imports rather than explicit relative imports.
Why? Using absolute imports couple the internal implementation of a package to its public name - you can't just change the top level directory name any more, you have to go through and change all the absolute imports as well. You also can't easily vendor a package that uses absolute imports inside another project either, since all the absolute imports will break.
What's the concrete benefit of using absolute imports that overcomes these significant shortcomings in maintainability and composability?
Regards, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] [Python-checkins] cpython (3.3): check the return value of new_string() (closes #18470)
- Next message: [Python-Dev] Why does PEP 8 advise against explicit relative imports?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]