[Biopython-dev] Python 2 and 3 migration thoughts

Peter Cock p.j.a.cock at googlemail.com
Sat Oct 26 18:44:59 UTC 2013


On Tue, Oct 22, 2013 at 5:42 PM, Peter Cock wrote:
> On Tue, Oct 22, 2013 at 5:35 PM, Eric Talevich wrote:
>> For docstrings, I agree that directly showing the try/except block is more
>> informative for users on either genus of Python.
>
> Agreed.
>
>> For the rest of the
>> codebase, I would favor using a bundled copy of six (e.g. Bio._six). The
>> benefits are (a) not having to discover and fix all the subtle bugs
>> ourselves, (b) to be explicit about where we've done something for Py2/3
>> compatibility and not as an essential part of the way the code is supposed
>> to work, and (c) six has its own documentation.
>>
>> I also see some virtue in not relying on six/Bio._py3k where it's not
>> necessary, since six is compatible back to Python 2.4 and we only go back to
>> Python 2.6 now. Halfway approach: just look at six and copy only the bits we
>> need into _py3k?
>
> OK, I'll focus in that direction then. Six is MIT licensed so we should
> be fine bundling it or extracting snippets.

A new pull request for people to comment on, which eliminates
all but two important fixers. As a bonus this makes installation
under Python 3 much much quicker:

https://github.com/biopython/biopython/pull/250

I've not (yet) needed anything from the 'six' library.

Peter



More information about the Biopython-dev mailing list