Python 2.6 and 3.0 Beta 1 Released.

I can finally crawl out from under the rock I’ve been under to happily pass on the news that Python 2.6 and 3.0 Beta 1 is officially released. For those of you living on the moon – this release is especially exciting for me for a few reasons:

  1. PEP 371, the addition of the pyprocessing module (as the multiprocessing module) has been implemented.
  2. This was my first serious foray into core-development, so I learned a lot (some rather painfully/embarrassingly).
  3. I ended up with commit privileges so I can help maintain the new package/module. My first checkin was unfortunately a patch to disable some tests that came in with the package.
  4. I killed the buildbots and delayed the beta.

Mad props/thanks need to be passed on to a few people – Benjamin Peterson, Adam Olsen, Richard Oudkerk and many others helped get this done and helped me debug various problems that were exposed after the new package went in.

The docs for the package are here (2.6 dev docs). It’s in both py3k and py2.6

I’ll be working over the next few weeks on cleaning up the tests, the build and the docs for the new package. I welcome suggestions and urge people to file bugs they find in the bug tracker. Of course, if you include a patch – that’s even better.

If you’re looking for some cooler-stuff with the package: Look at the examples. The final one is an example of how to use the package to spread work amongst a cluster of machines.

You’re going to notice something “special” about the package included in python if you have worked with it in the past: The methods have changed names. There was a discussion on Python-Dev in the context of the package’s inclusion about whether or not to stick with “strict” threading module API naming, or to take this as a chance to move towards PEP 8-style naming. We chose the latter, and in fact the threading module itself is getting re-worked over time to move to the same PEP-8 style naming (tbd: I still need to pep this up). I think dropping the old Java-Style naming and going with Pythonic naming and accessing of things will be a generally Good Thing.

I’ve had to reiterate this a few times – but since I’m cheerleading, I might as well do it again: I do not think that the addition of this package is the “silver bullet” for “concurrency in python”. I also don’t think it will solve 100% of all the problems out there for people. It’s useful, and a best of breed: but it is only one step in a larger movement. Adoption of Adam Olsen’s work, continuing to refine the multiprocessing package, and thinking about distributed message protocols within the stdlib are just a few of the things we can do.

I’m seriously thinking about doing a introduction talk about the new package/concurrency stuff at pycon 09, although I don’t know how many people would be interested.

Doing all of this work also got me even more excited for 2.6 and 3.0 – I really do recommend people download the new builds and really hammer them, it’s important the final versions be as bug-free as possible.

  • I just downloaded the tarball for 2.6b1, compiled in on a macbook pro (10.5.3) and tried the clustered server sample but didn't get very far.. are you sure it's in there? :P I'm probably missing something here..

    $ python2.6
    Python 2.6b1 (r26b1:64398, Jun 20 2008, 00:33:25)
    [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import multiprocessing
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named multiprocessing
  • Ok, so I double-checked the source tarball, I unpacked it and did the following - "./configure && make" after that, I fired up the python.exe executable in the build directory:


    woot:Python-2.6b1 jesse$ ./python.exe
    Python 2.6b1 (r26b1:64398, Jun 19 2008, 20:25:19)
    [GCC 4.0.1 (Apple Inc. build 5484)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import multiprocessing
    >>> dir(multiprocessing)
    ['Array', 'AuthenticationError', 'BoundedSemaphore', 'BufferTooShort', 'Condition', 'Event', 'JoinableQueue', 'Lock', 'Manager', 'Pipe', 'Pool', 'Process', 'ProcessError', 'Queue', 'RLock', 'RawArray', 'RawValue', 'Semaphore', 'TimeoutError', 'Value', '__all__', '__author__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', '__warningregistry__', '_multiprocessing', 'active_children', 'allow_connection_pickling', 'cpu_count', 'current_process', 'freeze_support', 'get_logger', 'log_to_stderr', 'os', 'process', 'sys']
    >>>

    So, I think it may be something in the compile step failing for you, or something else entirely. If you want, you can email me at jnoller at gmail dot youknowwhat.
  • Getting the same results on amd64 ubuntu:

    ~$ python
    Python 2.6b1 (r26b1:64398, Jun 19 2008, 07:34:18)
    [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import multiprocessing
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named multiprocessing
    >>>

    Perhaps it's related to the fact I have multiple Python interpreters installed (2.3 till 3.0)? I'll see if I can debug the issue and otherwise I'll send you that email. Thanks!
  • Guess this will fix the problem.. http://jessenoller.com/2008/06/19/minor-problem...
  • Yup, someone filed it last night and added a patch to the tracker. Sorry about the problems - I tend to run from subversion rather than doing any sort of make install step
  • I hope not! I did all the heavy lifting on my macbook pro, so I just downloaded the src tarballs (I've been running off of trunk) and I'm checking it now.
  • llimllib
    Do a pycon talk! I'd definitely be interested.

    Great work.
blog comments powered by Disqus