Python 3.0 upgrade incompatible with earlier versions

The Python Software Foundation is working concurrently on two upgrades to the core language and anticipates most people will stick with the Python 2 line for years

Python 3.0, a new version of the language released earlier this week, has incompatibilities with the 2.x line, according to the Python Software Foundation.

While saying the language is mostly the same, the foundation said details such as how built-in objects like dictionaries and strings work "have changed considerably and a lot of deprecated features have finally been removed." The standard library also has been reorganized to make it more accessible and discoverable.

Python vs. PHP: Choosing your next project's language

In a blog posting on Thursday, Guido van Rossum, lead developer of Python, called the 3.0 release "the first ever intentionally backwards incompatible Python release."

"There are more changes than in a typical release, and more that are important for all Python users. 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.

Interviewed Friday morning, foundation representative David Goodger said "We fixed problems so we can go forward and add features more easily in the future without having to work around previous bad decisions."

A transitional release toward the 3.0 platform, Python 2.6, was released in October and updated with bug fixes in Python 2.6.1 this week. A Python 2.7 release also is planned, and the foundation anticipates most people will stick with the Python 2 line for years, Goodger said.

First released in 1991, Python is a general purpose language that has been popular in Web development. Among the new features in Python 3.0 are simplified rules for ordering comparisons, replacement of the print statement with a print function, and use of views and iterators instead of lists. Syntactic changes also have been made.

Python 3.0 uses concepts of text and binary data instead of Unicode strings and 8-bit strings. Text is Unicode but encoded Unicode is represented as binary data.

"As a consequence of this change in philosophy, pretty much all code that uses Unicode, encodings, or binary data most likely has to change," according to the foundation. But the change is for the better, the foundation said. With Python 3.0, the default way to handle text is to use Unicode throughout, Goodger said.

Featured with Python 2.6 is a tool called 2to3, to translate Python 2.6 code to Python 3.0. That tool will be improved along with the Python 2 line, Goodger said.

Python 3.0 is downloadable here.

Join the PC World newsletter!

Error: Please check your email address.

Tags python

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Paul Krill

InfoWorld
Show Comments

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?