[Tutor] Differences between Python 2.2 and 1.5?

Magnus Lycka magnus@thinkware.se
Sun Jan 19 05:07:01 2003


At 23:22 2003-01-18 -0800, Terry Carroll wrote:
>I'm a new and casual Python user, just writing a few prgrams for my own
>use, and am wondering if there are any differences a casual user would run
>into between 1.5.2 and 2.2.2.  If so, I'll ask them to upgrade.  I don't
>think many on my ISP use Python, and quite frankly, our sysadmin is a busy
>and highly competent guy, and I don't want to unnecessarily take his time
>away from other projects he's working on.

First of all a warning. Don't use 1.6 at all, it's broken.

1.5.2 was a stable and good version. There are a number of changes made
since then though. A major one is string methods introduced in 1.6, which
means that you can write

"hello world".upper()

instead of

import string
string.upper("hello world")

Some other big changes:

* Unicode support
* XML support
* distutils - standard for installing 3rd party python packages
* nested scopes - useful if you use nested functions or lambdas
* class/type merge - now you can subclass int, string etc.
* changed division - 5 / 2 => 2.5 if you do "from __future__ import division"
* List comprehension - as in l = [int(x) for x in y if x in "0123456789"]
* Improved garbage collection - No more worry about cycles.
* Augmented assignment - x += 5 etc.

See:
http://www.python.org/1.6.1/
http://www.amk.ca/python/2.0/
http://www.amk.ca/python/2.1/
http://www.python.org/doc/2.2.1/whatsnew/

You can certainly do a lot of good things in 1.5.2 but it seems a bit
silly if you can't use several years of python improvements. And many
third party packages no longer support 1.5.2. This means that you might
download some module that does something you find useful, just to discover
that you can't use it.

If you could get all your plaforms up to 2.2.2, it's a good thing. After
all, 1.5.2 is fairly old, and not even Red Hat stick to it any longer...

If your ISP is running a non-current Red Hat, they need to have 1.5.2 as
/usr/bin/python. Then they can have (might already have?) a newer python
installed as /usr/bin/python2. Perhaps you should check that?


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se