biopython/biopython — pull request #250 by peterjc (2013-10-26 18:41:54+00:00)
Title: Big set of Python 3 tweaks to almost eliminate use of 2to3

This replaces pull request #249, defining commonly used modules which moved between Python 2 and 3 under `Bio._py3k` to allow a consistent import statement in our code base. User facing examples in the doctests (and a few rare imports like cPickle) are handled with a try/except for the imports.

With all these changes, we are down to just two fixers left to address (`unicode` which I have already started working on, and `nonzero` which will probably require *in situ* Python specific code). It is now simple to update `do2to3.py` to selectively run only on the files which need changing. This makes building/installing under Python 3 *much* faster.

The most noticeable style change is we now always treat map, range, zip etc as Python 3 style iterators - and to enforce this use import these from `Bio._py3k`. Do *not* use the Python 2 specific `range` function, instead:

from Bio._py3k import range # remove once we drop Python 2 support

Also, we now import `urllib` functions from `Bio._py3k`.