[Tutor] 1.5.2 to 2.x.x upgrade question (fwd)

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 17 Sep 2002 09:02:30 -0700 (PDT)


Hi James,

You probably meant to reply to the whole Tutor list.  I'll forward your
message for you.

(Side note: you probably want to turn off HTML mode on your mail program;
the HTML in your message is obscuring your message for potentially many
people.)

---------- Forwarded message ----------
Date: Tue, 17 Sep 2002 05:20:56 -0700 (PDT)
From: James Clare <jrclare@sbcglobal.net>
To: Danny Yoo <dyoo@hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] 1.5.2 to 2.x.x upgrade question

<P>If you upgrade, do it in another&nbsp;directory
and&nbsp;point the shebang line to the new directory.
If you have problems with an old program just use the
older version.
<P>&nbsp;<B><I>Danny Yoo
<DYOO@HKN.EECS.BERKELEY.EDU></I></B>wrote:
<BLOCKQUOTE style=3D"PADDING-LEFT: 5px; MARGIN-LEFT:
5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>On Tue,
17 Sep 2002, Kirk Bailey wrote:<BR><BR>&gt; If I can
upgrade critter to2.foo, will I have to rewrite a
bunch of<BR>&gt; scripts, or will all the scripts
working now continue to operate<BR>&gt; correctly
under the new version?<BR><BR>Ideally, the code should
be portable from 1.52 to 2.2.1. Realistically,<BR>you
might run into a small snag or two, but nothing too
major. *grin*<BR><BR><BR><BR>One of the "major"
changes was to the list.append() method, where in
old<BR>version of Python, if we gave append() multiple
arguments, it would work<BR>with
it:<BR><BR>###<BR>bash-2.04$ python<BR>Python 1.5.2
(#1, Apr 13 2000, 18:18:10) [GCC 2.95.1 19990816
(release)]<BR>on sunos5<BR>Copyright 1991-1995
Stichting Mathematisch Centrum,
Amsterdam<BR>&gt;&gt;&gt; l =3D []<BR>&gt;&gt;&gt;
l.append(1,2,3)<BR>&gt;&gt;&gt; l<BR>[(1, 2,
3)]<BR>&gt;&gt;&gt;<BR><BR>This example shows that
Python 1.52 would append the tuple object
(1,2,3)<BR>into our list. But this is a little weird,
because then we have two ways<BR>of doing the same
thing:<BR><BR>l.append( (1, 2, 3)
)<BR><BR>or:<BR><BR>l.append(1, 2, 3)<BR><BR>To fix
what appears to be a bug, Python 2 opts to make the
second form of<BR>append() here obsolete with an error
message:<BR><BR>###<BR>dyoo@coffeetable:~$
python<BR>Python 2.2.1 (#2, Sep 7 2002,
15:35:22)<BR>[GCC 2.95.4 20011002 (Debian prerelease)]
on linux2<BR>Type "help", "copyright", "credits" or
"license" for more information.<BR>&gt;&gt;&gt; l =3D
[]<BR>&gt;&gt;&gt; l.append(1,2,3)<BR>Traceback (most
recent call last):<BR>File "<STDIN>", line 1, in
?<BR>TypeError: append() takes exactly one argument (3
given)<BR>###<BR><BR>I think that was the major
compatibility change there; the majority of<BR>the
other changes have been additional features (like list
comprehenions),<BR>or improvements in the standard
library %=10=10_=06=F8=0F_=06=02