[Python-Dev] PEP 328 - Relative Imports (original) (raw)

Shane Holloway (IEEE) shane.holloway at ieee.org
Sat Sep 11 08:25:38 CEST 2004


M.-A. Lemburg wrote:

People are more likely going to make all imports absolute (like they already do in Java and other languages) - which is good, since it makes reading code much easier and allows for writing packages which are compatible to older Python version, but it also prevent developing applications using the above approach.

I also don't think that extension writers will care enough to make their packages fully relocateable by using relative imports all over - these are hard to read and don't buy the developer of the extension anything. Anyway, what should the strategy for the PEP look like ? 1. postpone the defaulting to absolute until P3k 2. provide a way to customize the behaviour using e.g. a sys function

As a package writer, I will go through the effort to write relative imports for a few reasons.

Unfortunately, it'll be a while before I can target Python 2.4 directly. But it will be good when I can!

Thanks, -Shane Holloway



More information about the Python-Dev mailing list