Thursday, September 21, 2006

Python 2.5 Released

Python 2.5 has been released, ahead of schedule. I announced this version back in March, at which time it was due in mid-October. See that previous post for a summary of new features. I'll cover others here.

In making the transition, there's one thing to look out for in your code modules. If you use any non-ASCII characters you need to put a declaration at the top of the file specifying the encoding. In Python 2.4 this triggered a warning, but now it gives you a syntax error. Go fix those files!

Several deprecated modules have finally been removed, so if your code uses any of the following you will finally have to rewrite: regex, regsub, statcache, tzparse, whrandom.

In addition to those I mentioned before, there are further new standard library modules. ctypes lets you call arbitrary functions in shared libraries or DLLs. wsgiref provides a WSGI-compatible web server for testing purposes.

A wrapper for the SQLite embedded database has been added, as sqlite3. I have used this database as an easily administered alternative to the "big boys". It's great for testing or to include in a standalone application.

As usual, performance has been improved, though maybe not as dramatically as in previous versions.

Finally, a nice tweak to the interpreter means that typing quit() or exit() will now exit the shell. It's common sense and long overdue, IMO.

RELATED POSTS

1 comment:

Brandon said...

Except it should have been "quit" or "exit" to actually be common sense. Why would I use a function call to get out of the interpreter? The Python devs are now going to check that box and say "Solved!" when in reality, it's hardly better than the old CTRL-D nonsense.

Post a comment