Getting ready for the Python breakage

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."

"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.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment

Terms of Service - As a ZDNet registrant, and by using this service, you indicate that you agree to our Terms and Conditions and have read and understand our Privacy Policy.

ZDNet Australia Live

Which Windows will make for a better tablet? http://t.co/4mAHg850

Gonna be crowded when TA switches of the inter webby thingy and everyone moves there, just as you suggested though.

29 minutes ago by Beta on NBN users opt for 100Mbps

Yes "without secure internet identification methods" I cannot see a future for online voting be it a referendum or selecting a Gov (at ...

1 hour ago by Taskmanager on A farewell to democracy: Kaspersky

Oh of course you would would want something in return. hmmm I see, well maybe my best wishes for and your family. btw, Western Union is ...

1 hour ago by Doubt on NBN users opt for 100Mbps

Well Willunga looks like a nice place to live, close to wine growing areas, a golf club. Houses are probably reasonably priced. Very nice...

1 hour ago by Doubt on NBN users opt for 100Mbps

Listening to @stilgherrian cover AusCERT and cyberwar, http://t.co/6lGUEz8H

http://edfarmaciaes.com/#0500 generico viagra barcelona EdFarmaciaEs sildenafil y sulfatos

1 hour ago by buy priligy cheap on Top alternatives to Microsoft Outlook

Travel Tech Q and A: Skyscanner's Ewan Gray http://t.co/VN5tGJzC

#Westpac Board goes paperless with #Ipads with #Tabula #App http://t.co/duxuj2fd #Cybersecurity #Bank

Microsoft is serious about open source??? http://t.co/mqQGgta7

If I give you money what do I get in return? Do you know how commerce works or are you just a filthy poor that wants my monies for nothin...

1 hour ago by Hubert Cumberdale on NBN users opt for 100Mbps

@joedamato just try varying caps randomly. Maybe they do this http://t.co/1FN5FwYv

NSW outlines datacentre migration plans - Hardware - News - ZDNet Australia http://t.co/OQfUl0D1

MikeSkoey - thanks for your comments. Rather than hang my head in shame, I am proud of my achievements, particularly of being able to ru...

2 hours ago by Paul_Berryman on 30 servers to 7: BUPA redoes virtualisation

The Liberals have no idea what to do and would just go back to the "do nothing" policy we had under Howard, Alston and Coonan.

2 hours ago by Magnus on NBN cost-benefit analyses are so 2011

"Why is that if someone who expresses a view different from the sheep, are immediately bandied a troll?" Nope. I prefer to call you some...

2 hours ago by Hubert Cumberdale on NBN users opt for 100Mbps

"on the new fast Internets everyone wants the fast plan" #orly #nareally #yarly http://t.co/kvfCa84A

This article needs a conclusion or recommendation advising Android users what to do about this. For example, are there reliable security...

2 hours ago by Magnus on Android's biggest security flaws

Kaspersky is right. Even though voting is compulsory here, Australia needs to start work on this now. Once such a secure online credent...

2 hours ago by Magnus on A farewell to democracy: Kaspersky

Chrome overtakes IE: does it matter? http://t.co/e4SILk8a

A ZDNet study showed that British Facebook users are drunk in 76 percent of their photos.

The HDMI cable ripoff and why retail is really dying http://t.co/eFT7zEW7

Travel Tech Q and A: Skyscanner's Ewan Gray http://t.co/IUysbyKf

Travel Tech Q and A: Skyscanner's Ewan Gray http://t.co/V7vL5QB9

Dazza - lets make a deal. I won't call you a troll if you don't call me a sheep. Anyway let's get some perspective on this. You cannot ...

3 hours ago by dickster on NBN users opt for 100Mbps

Further to the comments from James, I can add that most botnets will test the bandwidth of the end host before they take control of that ...

4 hours ago by patrickbutler on National Botnet Network coming: Earthwave

ZDNet reports Microsoft launches its own social service http://t.co/VJS5BkwF

by http://t.co/vmlLt4bh: Travel Tech Q and A: Skyscanner's Ewan Gray: Ewan Gray, Skyscanner's director for Asia P... http://t.co/4bfDRXo4

Travel Tech Q and A: Skyscanner's Ewan Gray http://t.co/CtNlVWN7

Travel Tech Q and A: Skyscanner's Ewan Gray: Ewan Gray, Skyscanner's director for Asia Pacific, shares some of h... http://t.co/ZxjpmqiM

Seriously, every business is slow to start off, that's common sense. But the NBN is attempting to replace an incumbent monopoly. So wait ...

4 hours ago by Beta on NBN users opt for 100Mbps

Microsoft is serious about open source: 10 proof points http://t.co/iv2ji74q

Ok, for all of those that are complaining about price lets look at it this way, Australia started using copper wiring back in the late 18...

4 hours ago by Kalthae on NBN users opt for 100Mbps

Ah so you have an anti-NBN website then...ok!

4 hours ago by Beta on NBN users opt for 100Mbps

@ Doubt, I think you should be a policy advisor to Tony Abbott. I can see it now pre-election 2013, Press Club - Journo: Mr Abbott, yo...

4 hours ago by Beta on NBN users opt for 100Mbps

@beachking, that's why the first N in NBN is of importance, because while this may come as a shock, the universe does not revolve around ...

4 hours ago by Beta on NBN users opt for 100Mbps

Err the words give it away "world class"... it's not Huawei class, China class or India class, it's world class! World Class from Farlex...

4 hours ago by Beta on NBN users opt for 100Mbps

How many billions of dollars have they spent for these 3500 connections? Whats the return in profit? How long are they going to keep subs...

4 hours ago by Dazza152 on NBN users opt for 100Mbps

Accelerator targets 'clean-tech' start-ups http://t.co/p9VPCzCa

RT @vexnews: NBN users opt for highest speed plan http://t.co/8eUvvVvQ

OutsourcingLive: #Outsourcing is still on the rise http://t.co/5U6R431A ^NK http://t.co/B8HtVvAD

In Facebook IPO fiasco the 'smart money' got burnt - ZDNet (blog): TIMEIn Facebook IPO fiasco the 'smart money' ... http://t.co/3iD1g6lG

But will we actually get 100mps Internet speeds often overstated RT@vexnews: NBN users opt for highest speed plan http://t.co/1uTiHXrd

RT @JamesVickery: NBN users opt for 100Mbps http://t.co/atP8fi1L

more cloud TV recording services tumble in wake of court victory for copyright monopolies - http://t.co/FEWm6Z7Y

Mike Quigley | Only 3500 NBN customers with active fibre services to date http://t.co/6eB525Ur via #auspol NBN very expensive failure

NBN users opt for highest speed plan http://t.co/8eUvvVvQ

http://t.co/ZWOl5p8F

http://t.co/JWINuozI

Remember, these are the high speeds that Mr Abbott believes you guys don't want.... http://t.co/Jtqnwb2M

Three tips for businesses to support connected customers http://t.co/to8fCl1N via @zite

Which Windows will make for a better tablet? http://t.co/wxr95itf via @zite

Cloud based TV recording services in Australia shutdown after negative ruling. http://t.co/9zlnSVJd

AD on azure, is all about APPS .. http://t.co/EMdsrHZF

#Outsourcing is still on the rise http://t.co/ANaHIofI ^NK

This story has been voted 12000 times in the last 24 hours!

2 days ago, Is Bill Gates a great leader?

This story has been voted 10 times in the last 24 hours!

3 days ago, CeBIT 2012 opens: photos

This story has been voted 15 times in the last 24 hours!

3 days ago, Lenovo ThinkPad 3G tablet (32GB)

Facebook Activity

Keep up with ZDNet Australia

ZDNet Events Calendar

ZDNet Events Calendar