[PEAK] Drop Python 2.3 support for the trellis?
Phillip J. Eby
pje at telecommunity.com
Sat Nov 17 15:35:00 EST 2007
One possibility I'm looking at for decreasing trellis memory usage is
to use a specialized subclass of weakref. By adding pairs of forward
and backwards pointers, it would be possible to make a linked list of
weakrefs and have them automatically unlink themselves when their
target is deleted. This would be ideal for managing notification
links in the trellis, especially under the new algorithm.
The downside, of course, is that weakrefs aren't subclassable in
Python 2.3. You have to have 2.4 at least. But currently, the
target version for pretty much all PEAK projects is Python 2.3, as it
has been for almost 3 years now. (We dropped 2.2 support in December '04.)
At the time, a big argument for keeping 2.3 was that it was what Mac
OS shipped, but by now Apple is shipping 2.5 (with setuptools,
even!). In my day-to-day work I use 2.5 mostly, as that is what
Chandler's built on, and the build folks at OSAF are planning to use
the system Python installations on Ubuntu and Mac OS Leopard. So 2.5
support seems pretty ubiquitous.
Looking at the PyPI download stats, there seems to be similar
interest levels between 2.3 and 2.4 for less-popular PEAK packages
like SymbolType and BytecodeAssembler. But for more-popular packages
like DecoratorTools and setuptools, interest in 2.4 and 2.5 versions
is nearly *two orders of magnitude* higher than interest in 2.3.
That suggests that the availability of 2.4 is quite good, and that it
might be reasonable to start dropping support for 2.3 in newer
packages. Going to 2.4 would certainly be a win for decorator
syntax, built-in sets, and the enhanced 'doctest' package (which in
some PEAK packages is kludged in as a backport to support 2.3).
So, I'm thinking it might be well worth dropping 2.3 support for the
Trellis. The Trellis' own download stats show 60 2.3 downloads vs.
90 for 2.4 and 110 for 2.5, so interest in the Trellis appears
somewhat correlated to the Python version in use. :)
However, that's still a pretty good number of 2.3 downloads. Is
anybody here in that group?
If worst comes to worst, I could probably figure out a way to kludge
up the weakref trick to work on 2.3, by not subclassing weakref and
instead wrapping one. It would, however, have degraded performance
and increased memory usage under 2.3. And of course it'd be more
work for me, so I probably wouldn't do it until the 2.4+ version was
stabilized. (i.e., the SVN trunk would be 2.4+ for a while.)
(Another alternative would be to create the specialized link type
directly in Pyrex or C, but that introduces its own headaches, and
still wouldn't be sane to implement prior to stabilization of the new
algorithm. But since link manipulation is likely to be where the
trellis spends most of its time, it would probably be worth doing at
More information about the PEAK