LWN.net Logo

Changes in the upcoming Python 2.4 Release

The first alpha release of Python version 2.4 is scheduled for release during July, 2004, according to the Python 2.4 Release Schedule. After several alpha releases and one beta release, the plan is to have Python 2.4 ready to go around September, 2004. A Python 2.4a1 pre-announcement has been sent out:

The purpose of this notice is to give people a heads up - if you have a bug that you want to see fixed for 2.4, start looking at it now. Fixes are welcome through the release cycle, although after the first beta fixes that result in a change to behaviour will be much less likely to be accepted.

A.M. Kuchling's What's New in Python 2.4 document details some of the changes that will occur in the language. There are a number of new Python Enhancement Proposals (PEPs) that go with this release. Here are some of the changes:

PEP 218: Built-In Set Objects

Two new built-in types, set(iterable) and frozenset(iterable) provide high speed data types for membership testing, for eliminating duplicates from sequences, and for mathematical operations like unions, intersections, differences, and symmetric differences.

PEP 229: Generator Expressions

Now, simple generators can be coded succinctly as expressions using a syntax like list comprehensions but with parentheses instead of brackets. These expressions are designed for situations where the generator is used right away by an enclosing function. Generator expressions are more compact but less versatile than full generator definitions and they tend to be more memory friendly than equivalent list comprehensions.

PEP 322: Reverse Iteration

A new built-in function, reversed(seq), takes a sequence and returns an iterator that returns the elements of the sequence in reverse order.

PEP 237: Unifying Long Integers and Integers is not yet finished, the title is self-explanatory.

The Other Language Changes section mentions modifications to these functions: dict.update() ljust(), rjust(), center(), sort() zip() itertools.izip().
Also, there will be a new string rsplit() function and a new sorted(iterable) built-in function.
A number of optimizations for lists and tuple operations are also mentioned.

The New, Improved, and Deprecated Modules section details changes to the Python standard library. Here are some of the changes:

  • Transparency support has been added to the curses module, the bisect module has improved performance, There are now improved Asian encodings, and a new collections module for various specialized collection datatypes has been added.

  • The ConfigParser and heapq modules have had performance improvements. The imaplib module has support for the IMAP THREAD command. The itertools module gained several new functions.

  • The POSIX module has a new getsid() function, the operator module gained two new functions, and the random module can now generate arbitrarily large random numbers.

  • The re (regular expression) module has new conditional expression support, and the weakref module has expanded capabilities.

Finally, the cookielib library now supports client-side cookie handling.

The Porting to Python 2.4 section mentions some issues that developers may want to look at when porting code to Python 2.4.

Writing and testing all of that code should keep the Python developers busy for a while.


(Log in to post comments)

Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds