Getting ready for the Python breakage

Angus Kidman, ZDNet.com.au

01 February 2008 12:26 PM

Tags: python, linux.conf.au, google, code

If Google starts behaving oddly later this year, it might not be due to too many YouTube videos of Britney Spears losing it or a stealth attack by Microsoft's minions, but because of a forthcoming change to the Python programming language.

The launch of version 3.0 of Python, expected within the next year, will see major changes to some fundamental elements of Python, release manager Anthony Baxter explained in a keynote speech at linux.conf.au in Melbourne.

Python is used extensively by Google for many of its products, including the popular YouTube video sharing site.

"3.0 is also known as the release where we break all your code but we're doing it for a good reason," Baxter said. "Python is 16 years old. Like all 16 year olds, it's got some really annoying features."

Want to know more?

For all the latest news, analysis and opinion on open source, click here

"Pretty much every program will need changes," Baxter said, but he stressed that the shift would be some time in coming. "2.x is also not going away. There is going to be a 2.6, it'll be out at about the same time as 3.0. We're not expecting everyone to turn around and rewrite their massive code bases the day after 3.0 comes out -- that would be very foolish. We'll keep maintaining [the 2.x series] as long as there is interest and need."

Both the 2.6 and 3.0 releases are due to appear in late 2008 or early 2009. "I really do think it'll be early next year before it's out. I think there's so much work to bed it down," Baxter said.

When they do come, those alterations will present a big challenge to a company like Google, where Baxter has his day job. Around 15 percent of the search giant's total code base is written in Python. "We get a lot of coders. Obviously I can't say how many, but it's a lot," Baxter noted.

The increasingly complexity of the language has made it difficult for Google's developer teams to work with multiple languages. "[Python] is used for a lot of the core glue. People are having to bounce between Java and Python. They need to context switch. In that case, a lighter-weight language is a huge bonus. For these guys, simpler is much, much better."

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.

"The other one that's going to break a lot of code really subtly is that Unicode is now the default. There's a real shambles in Python at the moment when it comes to mixing Unicode and non-Unicode strings."

Other alterations, 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 backward 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.

"It's a good thing, backward compatibility, but you have a cost. There's always a cost when you make a decision to keep around the old rubbish. It hurts.

"To minimise problems with changes, Python 2.6 is also being altered to warn developers of constructs which might prove troublesome when they shift to 3.0. "In 2.6 we've added a bunch of warnings, and there's going to be more of these going through," Baxter said.

Like this article? Click below to send it to your mobile for free!

Talkback 2 comments

  1. What's with the header to this article? Anonymous -- 02/02/08

    That's a pretty sleazy lede guys. Look --

    - YouTube won't break. Nobody is telling Google to 'you will assimilate', Py 2.5.x will be on the support path for quite a while. so they can stay there quite a while while the code is recalibrated.

    - It has been a known fact by the Py community that there would be a clean break with 3.0. No surprises there.

    Scares are not needed.

  2. OMG, Python's Going to Destroy Google! Anonymous -- 05/02/08

    ...not. Good grief.

    If anything, Google is in a better position than most to handle the changes in Python, given that Python's lead programmer, Guido van Rossum, is a Google employee.

    Python's an excellent programming language, one of the cleanest and most productive language designs in the industry, and this change will make it nicer still. Not a huge story, not an excuse for panicky speculation, just a good tool getting better.

Add your opinion


Sponsored content

Power Centre - Content from our premier sponsors

Blogs

  • Renai LeMay StartupCamp Melbourne: The review
    StartupCamp Melbourne looks to have produced just as interesting ideas as the Sydney event which immediately preceded it, but the Victorian start-ups appear to have stumbled during execution. Sydney 1, Melbourne 0.
  • Array Google should come clean on datacentres
    It's nice that Google says it has put an effort into making its datacentres more energy efficient, but the search giant's pledges won't mean much until it discloses just how many of the beasties it's actually running.
  • Array US shows what OPEL could have been
    Sprint's WiMAX roll-out in Baltimore will prove the Australian government's decision to worm its way out of the Opel WiMAX contract was a short-sighted, and ultimately damaging, political stunt that has benefited nobody.
  • More blogs »

Tags

Back to top

Featured