[Python-Dev] release23-maint branch CLOSED for release (was Re: 2.3.3 cycle)

Barry Warsaw barry at python.org
Thu Dec 4 10:02:54 EST 2003

On Thu, 2003-12-04 at 09:51, Fred L. Drake, Jr. wrote:
> Jeremy Fincher writes:
>  > I thought the logging module was supposed to remain 1.5.2-compatible.

So says PEP 291.

> That sounds vaguely familiar.  If we really want the copy distributed
> with Python to be compatible with Python's that old, we can use a
> different approach.  Unfortunately, we can't simply add something like:
> if sys.version_info >= (2, 3):
>     def apply(func, args, kw=None):
>         if kw is None:
>             return func(*args)
>         else:
>             return func(*args, **kw)
> This isn't permissible since it would cause a SyntaxError for Python
> 1.5.2; we'd have to enlist the "exec" statement to make this work.

The email package has a fairly elaborate mechanism to support
compatibility with older Pythons.  It segregates syntactically
incompatible stuff into separate modules _compat21.py and _compat22.py
and then imports the appropriate one based on the Python version.  Yes,
it's a hack.

> Do we still really want to support Python 1.5.2?  That just seems
> quite extreme to me; even PyXML is no longer maintained for Python
> 1.5.2.

I think I'd like to elaborate PEP 291 a bit.  It seems perfectly
reasonable to say that Python 2.3's email package must remain compatible
with Python 2.1, but that Python 2.4's email package needs no such
backwards compatibility.  Now, the email package has its own version
number so in that sense, I could say that email 2.x is Python 2.1
compatible but email 3.x requires Python 2.3 or 2.4.  I'm not sure how
well that works with the other packages listed in PEP 291, but given
that Python has multiple branches, I don't think we have to require the
code on the trunk to keep backwards compatibility with ancient Pythons.


More information about the Python-Dev mailing list