might compatibility become a *goal*?

Greg Weeks weeks at vitus.scs.agilent.com
Fri May 17 12:29:23 EDT 2002


Python is not backward compatible.  New versions of python don't work with
old code.  (The redefinition of "/" is an example of this.)  My hunch is
that C, C++, and perhaps even Perl are considerably more backward
compatible than Python.

[I should perhaps note that *exact* backward compatibility isn't a
reasonable goal for Python.  For example, increasing the visibility of
nested scopes breaks the following code:

    def f(a):
        def g():
            print a
        g()
    try: f("hello")
    except: print "bye"

In 1.5.2, "bye" is printed.  In 2.1, "hello" is printed.  But this is an
absurd example, where the programmer achieves an effect with deliberate
perversity.  Putting such goofy code aside, I suspect that backward
compatibility is a reasonable goal.]

Backward compatibility does not seem to be a goal of the controllers of
Python.  (Is that just Guido?)  Indeed, lack of backward compatibility
seems to be an expected "feature" of Python, given the introduction of the
__future__ module.  On the other hand, if enough people wanted backward
compatibility, it might be possible to make it a goal that, say, all
Pythons after 3.0 will be backward compatible with (nongoofy) 3.0 code.  I
for one would feel happier if that was the case.  Is that a feasible goal?
Does anyone else think it might be worthwhile?


no longer complaining about TIMTOWTDI,
Greg



More information about the Python-list mailing list