[Python-Dev] Re: PEP 328 -- relative and multi-line import

Aahz aahz at pythoncraft.com
Sat Apr 10 14:33:10 EDT 2004


On Sat, Apr 10, 2004, Bill Janssen wrote:
>Aahz:
>>
>> Nope.  Absolute imports are the most common form, and we do want to
>> encourage absolute imports whenever possible (because of the conflicts
>> with the stdlib).  Relative imports should be "marked".
> 
> Wow.  This seems amazingly user-hostile.  Users (not Python
> developers) download some two or three year old code to do something
> from an online library, like the Vaults of Parnassus, and it just
> breaks because the meaning of "import" has changed.  I hope we aren't
> developing the kind of attitude towards non-developer users that made
> lispers call them "lusers".

In addition to Andrew's excellent response, I want to point out that this
only affects packages; most of the distributed code that I've seen tends
to be in single modules.  It also only affects packages that rely on
relative imports: as Barry points out, there's a significant set of
developers that currently uses only absolute imports because of the
tricky semantics for relative imports.

Also, by the time imports start to fail, what is currently two or three
year-old code will be five or six years old.  Anyone who is writing code
now will be aware of this issue and should be able to future-proof their
code if they want.  Nobody should expect to download code that's five or
six years old and have it just work.

Do you still think this is a "user-hostile" attitude?  If yes, you'll
need to make your case in more detail.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?



More information about the Python-Dev mailing list