The Null Device

Python 3000

The core developers of Python (a rather elegant open-source programming language, in which, incidentally, this website is written) have broken ground on Python 3000, the massive, compatibility-breaking overhaul they intend to give Python, fixing the mistakes, shortcomings and inelegancies in the current version. Here are the things that will change, and here are the things that won't.

It's heartening to see that lambda functions (once slated to be abolished) have been given a reprieve. Otherwise there would have been no concise way of passing anonymous functions as a data type, and instead of being able to do something like (to quote a rather silly example):

greeters = { 
    'english'     : lambda name: "Hello, %s"%name,
    'french'      : lambda name: "Bonjour, %s"%name,
    'australian'  : lambda name: "G'day, %s"%name
}
one would have to take the long way around, doing something like:
def greet_english(name):    return "Hello, %s"%name
def greet_french(name):     return "Bonjour, %s"%name
def greet_australian(name): return "G'day, %s"%name

greeters = { 'english': greet_english, ... }
And I don't buy the argument that anonymous functions are bad form, and that each chunk of code should have a name that describes what it does. There are many instances where one wants to specify a tiny fragment of code which will fit into a larger mechanism like a small but crucial cog (be it in a function call, a data structure or wherever), without the bureaucratic overhead of giving it a name. Otherwise we may as well be programming in Java or COBOL or some Vogon-designed abomination of a language.

There are 2 comments on "Python 3000":

Posted by: Antiwikipedia http://www.antiwikipedia Tue Aug 29 22:18:03 2006

Interesting blog! I was curious as to where I could find more of I Want A Hovercraft as their page linked from the wikipedia article you wrote is broken. Thanks!

Posted by: acb http://dev.null.org/ Tue Aug 29 22:55:40 2006

No idea; try a Google search.

Want to say something? Do so here.

Post pseudonymously

Display name:
URL:(optional)
To prove that you are not a bot, please enter the text in the image into the field below it.

Your Comment:

Please keep comments on topic and to the point. Inappropriate comments may be deleted.

Note that markup is stripped from comments; URLs will be automatically converted into links.