[Spambayes] RE: Further Improvement 2

Tim Peters tim.one@comcast.net
Sun, 22 Sep 2002 01:24:43 -0400


[T. Alexander Popiel]
> Well, I was about to start doing some real tests using my corpora,
> but immediately ran into the 'requires python 2.3a0' comment.  I'll
> be honest:

Please, anything but that <wink>.

> I don't use python much, and I'm not particularly inclined to drag an
> alpha version of it out of CVS.  Is there any good reason to make the
> filter depend on that version of python?

I'm a Python developer, and when I started this code I wanted it also to
serve as a stress test for several new features in Python 2.3.  Most of the
other coders on *this* project are also developers on the Python project.
It's just an historical quirk.

> What is it that would keep it from running using python 2.1.3
> (the debian stable default)?

Sorry, but I barely remember the 2.1 line anymore.  The current stable
release is 2.2.1.  The 2.3 features we're using over that are shallow:

+ Use of the new-in-2.3 "sets" module.
+ Use of the new-in-2.3 "heapq" module.

Those are pure Python modules and would probably work fine if just dropped
in as-is to a 2.2 Lib directory.

There are other minor 2.3-isms, like use of the new builtin "enumerate"
function (easily emulated with a Python function).

There's ubiquitous use of generators ("semi-coroutines"), though, and that's
never going to fly in the 2.1 line.  In the 2.2 line, it would just require
adding

    from __future__ import generators

to the top of a few modules.

So I expect it would be an easy project to get this code working under 2.2,
but for someone more conversant with Python than you are so far.  It's not
something I'm going to do, though -- anyone else?