Major Python update makes break with past
Python 3.0 is a major change from the Python 2 series, and the first release that is intentionally backwards-incompatible.
Python developers on Wednesday released the final version of Python 3.0, a major reworking of the programming language that is incompatible with the Python 2 series.
Python is widely used for Web applications such as YouTube. Python 3.0, also called Python 3000 or Py3K, is the first Python release that is intentionally backwards-incompatible, according to project founder Guido van Rossum.
"Nevertheless, after digesting the changes, you'll find that Python really hasn't changed all that much--by and large, we're mostly fixing well-known annoyances and warts, and removing a lot of old cruft," van Rossum said in a document outlining the changes.
The most significant changes include modifications to the workings of built-in objects, such as dictionaries and strings, and the removal of older features, according to the Python development team. The standard library has been reorganized in some prominent places, developers said.
In general, the changes are designed to simplifyand remove needless complexity that has built up over time, according to van Rossum. However, Python developers have long made it clear that the new release would necessitate changes in most Python-based applications.
"3.0 is also known as the release where we break all your code, but we're doing it for a good reason...Pretty much every program will need changes," said release manager Anthony Baxter in a keynote speech at Linux.conf.au in Melbourne in February.
Baxter stressed that the shift would be some time in coming. "2.x is also not going away...We'll keep maintaining (the 2.x series) as long as there is interest and need," he said.
One of the most notable changes is turning the "print" statement, used for all kinds of information output, into a function. "Currently print has awful syntax for doing all sorts of things," Baxter said.
He said another major change is that Unicode will now be the default. "There's a real shambles in Python at the moment when it comes to mixing Unicode and non-Unicode strings," Baxter said.
Other changes, such as altering models used for division and switching the symbols for "not equal" from "" to "!=", have long been discussed in the Python community but have been held back because of fears over backwards compatibility. With the shift to 3.0, the view is: "What the hell. We're breaking the code anyway; let's fix it", Baxter said.
Matthew Broersma of ZDNet.co.uk reported from London.