[Zope3-dev] Requiring Python 2.3 (was: zope3 doesn't likethe python datetime module?)

Tim Peters tim at zope.com
Mon Sep 22 21:03:14 EDT 2003


[Phillip J. Eby]
>> - booleans

> Those are in 2.x maintenance releases, no?

Builtins with names True, False, and bool are in the later 2.3 "bugfix
releases", but there's no bool *type* before 2.3.  If being able to
distinguish, e.g., True from 1 is important to an app, that's a big
difference (e.g., when talking with an external system that makes a bigger
distinction between integers and Booleans, it can be very helpful to
preserve the distinction in the Python code on the other end).

>> - the enumerate type

> zip(range(len(x)),x) is at least cleaner than it was in 1.5.2...  :)

A key difference is that zip() materializes a list requiring O(len(x))
space.  "for i, elt in enumerate(x)" takes O(1) space.

>> - unittest.TestCase being a new-style class (you may be laughing,
>> but with 5k+ unit tests in Zope3, this really might make a
>> difference)

> Aren't new-style classes *slower* than classics?  I believe this is
> the case for 2.2, anyway.

There's no answer to that short of listing each specific operation you want
to perform, with detailed context, and timing each one.  The new-style class
operations Guido cared about <wink> were sped up in 2.3, and 2.3 is
generally faster than 2.2.3 across the board.  Some programs are much faster
under 2.3 (in the 19 months 2.3 was under slow-motion development, none of
the speed enhancements were backported to a 2.2 bugfix release).

There are a ton of other improvements in 2.3.  Those Zope Corp funded
include new C date & time types; a new, more-efficient pickle protocol; and
Windows enhancements some Zope Corp products require (like os.waitpid(), and
arranging that temp files don't get inherited by spawned processes -- ZRS on
Windows requires these).




More information about the Zope3-dev mailing list