Python 2.6 is released, some highlights

October 2nd, 2008 § 8 comments

futurama_bender_sm.jpgWell, it’s final boys and girls. Python 2.6 is final and up on the site.

A whole lot of peo­ple put a ton of work into this release — Python 3.0rc2 will be out shortly, but the dev team made the deci­sion to focus on 2.6 so we could all get it but­toned up and out in the wild.

You should read “What’s new in Python” — it high­light what changed, and the sheer amount of work that went into this. Barry War­saw, Ben­jamin Peter­son and many, many oth­ers deserve a lot of credit for help­ing shep­herd this release to finality.

I’m very proud of this release — for a vari­ety of rea­sons. This is the first python release that I per­son­ally had a chance to directly con­tribute to, how­ever minor that con­tri­bu­tion was. Also, this is the first time I’ve been able — through an allowance of per­sonal, and work-time — to seri­ously con­tribute to an open source project I care about.

Some high­lights? Con­text Man­agers, the Per-user site-packages direc­tory, abstract base classes, class dec­o­ra­tors, and a ton of bug fixes.

The inclu­sion of the mul­ti­pro­cess­ing library was a bit of a wild ride for me — I had to learn a lot, very quickly. I didn’t get to add/fix all the things I wanted to, but that’s the way things go.

I like to think that the inclu­sion of this pack­age will help peo­ple solve prob­lems — that’s what makes me most excited about it. It’s not per­fect, and it’s not a solu­tion for every­one, but it’s darned use­ful, and I hope peo­ple get to use it, a lot.

I just want to point out some­thing about the pack­age — and con­cur­rency in gen­eral — Mul­ti­pro­cess­ing is a very spe­cific imple­men­ta­tion of a threading-like API for side-stepping the GIL, it is not the “final” word in con­cur­rency within the stdlib — it is one step­ping stone in a path that will hope­fully improve the lan­guage as a whole.

I can eas­ily see the cre­ation of a con­cur­rent.* pack­age for python, which might include higher level abstrac­tions for pools/message passing/monitors(actors)/etc for both this pack­age, and the thread­ing pack­age. This is going to be a long, inter­est­ing project — and I can only hope that we can really improve the lan­guage and stan­dard library as a whole. Again — it’s all about solv­ing problems.

That all being said — here are some tid­bits of what changed within the mul­ti­pro­cess­ing package:

  • As you can see from the docs, unfor­tu­nately, this pack­age does not work on FreeBSD/OpenBSD — it was an unfor­tu­nate casu­alty late in the game.
  • The boun­cy­Case names have been dropped in favor of PEP8 com­pli­ance within the API. The thread­ing mod­ule is also drop­ping the bouncy names to have fully PEP8 com­pli­ant names. It was decided that since MP was new, we would cut to the chase and sim­ply fix it’s API. In 2.6, the PEP8 com­pli­ant names have been added to the thread­ing mod­ule, and the old API will be even­tu­ally deprecated.
  • While chang­ing the API to remove the bouncy names, we also cut cer­tain things over to be python prop­er­ties in order to be more pythonic. These include “process.name”, “Process.daemon”, “Process.pid”, “Process.exitcode”, “Process.authkey”.
  • There are still open bugs against the pack­age — unfor­tu­nately, like the other peo­ple on python-dev, this is a part-part time job for me, and I couldn’t get to every­thing. Here’s a query to see which MP bugs are assigned to me, and their sta­tus (this includes closed bugs).
  • The doc­u­men­ta­tion includes some incred­i­bly help­ful exam­ples — includ­ing the last exam­ple, which uses the pack­age and SSH to cre­ate a dis­trib­uted net­work of work­ers. I’ll be build­ing on this/cleaning it up and switch­ing it over to use paramiko as part of my con­tin­u­ing work.

That’s just some of the work/thoughts that are ping­ing around in my head. I have a long wish list of things to add, includ­ing some message-passing examples/etc. Already, peo­ple are build­ing recipes/extening it — for exam­ple, David Decotigny has uploaded a recipe to add the same mp.Pool seman­tics to the thread­ing mod­ule as well as one to allow remote method calls and an addi­tional mp.Pool vari­ant here.

Feel free to file bugs — I wel­come them — I just may not be able to fix them really fast. Includ­ing patches is awesome.

As I said in the opener — a lot of peo­ple put a lot of effort into this release (and all the pre­vi­ous ones) so a big thank-you goes out to every­one. I encour­age you to down­load it, try it out, break it but most of all use it.

  • http://sprocket.io/ Thomas Stromberg

    Sad that OpenBSD/FreeBSD sup­port didn’t make the release (though it doesn’t show up on the issues page?). Is there a list of UNIX imple­men­ta­tions that it has been tested to work on? http://docs.python.org/library/multiprocessing.… sim­ply says ‘runs on both Unix and Windows’.

  • http://sprocket.io/ Thomas Stromberg

    Nev­er­mind on it not show­ing up on the issues page, it’s issue 3876.

  • jnoller

    I’ll add a list of supported/tested plat­forms to the docs — right now,
    it’s win­dows, OS/X, and Linux/Solaris AFAIK

  • jnoller

    The rea­son FreeBSD and OpenBSD sup­port is only par­tially there is not due to the pack­age — but rather the shared sem­a­phore imple­men­ta­tions on those plat­forms, which isn’t there, or only halfway there.

  • Richard Boul­ton

    Is there any plan to back­port pack­ages of mul­ti­pro­cess­ing to python2.5 (or indeed, ear­lier)? I’ve been using the “pro­cess­ing” pack­age with python2.5, but this seems to be pretty much orphaned now. I’m happy to try and do a back­port of mul­ti­pro­cess­ing myself, but I’d hate to dupli­cate effort… :)

  • jnoller

    I haven’t heard from Richard (the orig­i­nal main­tainer) for some time, I think this is a good idea though. I don’t have enough band­width to do it myself though

  • Richard Boul­ton

    Is there any plan to back­port pack­ages of mul­ti­pro­cess­ing to python2.5 (or indeed, ear­lier)? I’ve been using the “pro­cess­ing” pack­age with python2.5, but this seems to be pretty much orphaned now. I’m happy to try and do a back­port of mul­ti­pro­cess­ing myself, but I’d hate to dupli­cate effort… :)

  • http://jessenoller.com jnoller

    I haven’t heard from Richard (the orig­i­nal main­tainer) for some time, I think this is a good idea though. I don’t have enough band­width to do it myself though

What's this?

You are currently reading Python 2.6 is released, some highlights at jessenoller.com.

meta