[Biopython-dev] Python 2.3

Andrew Dalke dalke at dalkescientific.com
Tue Aug 5 03:55:16 EDT 2003

Andreas Kuntzagk:
> So we already depend on 2.3 ? Or can you use enumerate with 2.2?

The PEP which introduces enumerate includes Python 2.2 compatible
code which implements the same functionality.  Michael Hoffman
added that snippet to his code, so he could use it despite not
supporting 2.3.

It is possible to have a 'compatibility' module which lets some
2.3-style code work on 2.2 Pythons.  For example,

from Bio.compatibility import enumerate

This would be implemented as

except NameError:
   def enumerate ...

I've seen similar code used (rarely) in other modules.  I'm
not enthusiastic one way or the other, but I don't see any deep
problem with it.

> Btw. I was thinking, is there a better way to use the Iterator-classes
> in the different Modules?

*sigh*  Last time I worked on the parser code we still had 2.1
compatibility so I have lots of tricky, ugly code to emulate
iterators through __getitem__.  I need to clean that up.

(And what I really want is someone to pay me for it.  :)

Sadly, not happening soon.

					dalke at dalkescientific.com

More information about the Biopython-dev mailing list