[Biopython-dev] Phasing out support for Python 2.4?

Eric Talevich eric.talevich at gmail.com
Wed Jan 13 12:08:24 EST 2010


On Wed, Jan 13, 2010 at 9:10 AM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hi all,
>
> Biopython currently supports Python 2.4, 2.5 and 2.6
> (and seems to work on the current Python 2.7 alpha).
>
> Is it time to start phasing out support for Python 2.4?
>
> Reasons for encouraging Python 2.5+ include the
> built in support for sqlite3 (which we can use in the
> BioSQL wrappers) and ElementTree (which we use
> for the phyloXML parser) both of which must currently
> be manually installed for Python 2.4.

Also, it appears that Python 2.7 will use absolute instead of relative
imports by default:
http://www.python.org/dev/peps/pep-0328/

For intra-package imports like in PDB/__init__.py, an import like this:
from PDBParser import PDBParser

could be future-proofed for Py2.5+:
from __future__ import absolute_import
from .PDBParser import PDBParser

But to make it work in both Py2.4 and Py2.7, it would need to be
converted to an absolute import:
from Bio.PDB.PDBParser import PDBParser


Py2.5 introduced a number of other enticing syntax features, too:
http://docs.python.org/dev/whatsnew/2.5.html
- context managers (with_statement)
- if-else expressions
- unified try-except-finally (I flagged this issue in the comments in Bio.Phylo)
- all() and any()
- passing values into generators -- could be useful for parsing, maybe

The enhancements to setuptools might help simplify the dependency
handling in setup.py:
http://docs.python.org/dev/whatsnew/2.5.html#pep-314-metadata-for-python-software-packages-v1-1

I'm also interested in the functools and ctypes modules, but don't
have pressing use cases for them.
(So, you can take that as a +1 from me.)

Cheers,
Eric


More information about the Biopython-dev mailing list