[Types-sig] compatibility (was: tuples)

Greg Stein gstein@lyra.org
Tue, 21 Dec 1999 12:41:13 -0800 (PST)


On Mon, 20 Dec 1999, Tony Lownds wrote:
> On Mon, 20 Dec 1999, Guido van Rossum wrote:
> > The only reason not to switch to tuples is backwards compatibility --
> > in particular there is a lot of code (e.g. in the std library) that
> > creates new arg lists by adding tuples to *args.  This could be solved
> > by allowing + to operate on a mix of lists and tuples.  I think the
> > result should yield a list.
> 
> There would be forwards compatability issues too; people might starting
> writing:
> 
> class A:
>   def foo(self, *args):
>     args[:0] = [self]
>     apply(foo, args)
> 
>   def bar(self, *args):
>     ...
> 
> This code would not work on existing Pythons.

This kind of stuff happens all the time. There is code out there with
"assert" statements that don't work on old versions of Python. Python 1.6
has methods on the string objects; old versions do not.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/