Backwards Compatibility of Python versions

Martin v. Loewis martin at v.loewis.de
Sun Jan 13 16:40:07 EST 2002


Sheila King <usenet at thinkspot.net> writes:

> I responded, that it is essentially FUD. But, Python did recently release
> an upgrade that breaks old code (the whole division operator issue). Would
> someone like to respond to these concerns? I told the sysadmin that I would
> research this issue and report back.

Please have a look at

http://python.sourceforge.net/peps/pep-0005.html

It contains the official procedure for migrating to newer versions,
without silently breaking old code. The major point here is that no
breakage should happen silently: there will be advance warnings, so
users should have enough time to both analyse the costs of upgrading,
and finding out quickly what to change. This goes along with the
warning framework, see

http://python.sourceforge.net/peps/pep-0230.html

PEP 5 also gives the rationale for the future statement, see

http://python.sourceforge.net/peps/pep-0236.html

I very much doubt that either PHP or Perl guarantee full backwards
compatibility; for any new feature introduced, I'm pretty sure that I
can find a piece of code that breaks with the feature
present. Python's approach is similar to Java's in this respect:
Deprecated features will be warned about automatically.

It may be true that this procedure is not always followed fully,
e.g. when introducing a new function foo in a module bar, Python won't
automatically detect that the code

def foo():
  pass

from bar import *

print foo

will change due to presence of the new function. If such code is not
used, the warning framework and the future statement together should
provide a safe migration path for everybody.

Regards,
Martin



More information about the Python-list mailing list