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

Andrew Koenig ark at acm.org
Sat Apr 10 12:57:04 EDT 2004


> 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".

This is a tougher issue than it appears, as I have learned from my long
experience with C++.

The trouble is that if you commit yourself to backward compatibility, you
wind up with a growing list of decisions for which the default is wrong but
you didn't want to break code by changing it.  Each time you make such a
decision, you make it more difficult the next time to do anything but go for
compatibility again.  Ultimately, everyone has to remember to override the
defaults in lots of everyday circumstances, a mental burden that hurts
everyone from novices to experts.
 
On the other hand, if you don't commit yourself to backward compatibility,
you wind up with people downloading old code that breaks because things have
changed.

The third possibility is to support all alternatives forever, perhaps with a
mechanism such as "from __past__ import foo".  That's possible in theory,
but if changes include changes in semantics, it may be impossible for old
and new to coexist.  Moreover, even if they can coexist, testing becomes a
nightmare.

It's a trilemma--a choice between three unpleasant alternatives.  I don't
know the right answer, but I do wish to caution against assuming the problem
is trivial.




More information about the Python-Dev mailing list