[Biopython-dev] PEP8 lower case module names?

Peter Cock p.j.a.cock at googlemail.com
Mon Oct 22 17:08:47 UTC 2012


On Fri, Sep 28, 2012 at 11:50 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Thu, Sep 20, 2012 at 10:08 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> On Sun, Sep 16, 2012 at 1:34 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>>>>
>>>> I guess we need to have a little hack with the 2to3 library and
>>>> try defining our own custom fixer for the imports...
>>>
>>> I've made a start at this - the easy part seems to work :)
>>>
>>> https://github.com/peterjc/biopython/commits/py3lower
>>>
>>> ...
>
> The code to do this lower case name mangling remains
> a quite spaghetti like mess in do2to3.py but it now works
> enough to pass the test suite (with some but not all 3rd
> party dependencies installed) under Linux and my Mac
> OS X machine (where like Windows I have a case
> insensitive file system).
>
> ...
>
> So this idea to adopt PEP8 lower case module names
> as part of supporting Python 3 appears to be technically
> viable.

Has anyone else tried this branch yet? Has the lower case
module names under Python 3 idea grown on anyone?
I think it makes sense in terms of a long term vision - I do
expect to be primarily working under Python 3 within a
couple of years.

It occurs to me we can make a partial step in this direction
with moving to a directory for Bio.Seq, since this could be
Bio.seq instead. For example, we talked about something
like this:

Bio.Seq -> Bio.seq
Bio.SeqRecord -> Bio.seq.record
Bio.SeqFeature -> Bio.seq.feature
Bio.SeqUtils -> Bio.seq.utils
Bio.SearchIO -> Bio.seq.search

I'm not 100% sure where the Bio.SeqIO top level functions
would belong, either directly under Bio.seq or Bio.seq.record
might work too.

We can have imports setup so that all the classes etc
are only defined once, e.g. Bio/seq/__init__.py could
initially just contain 'from Bio.Seq import *' and so on.

(We'd commit to maintaining the old namespace for
at least as long as our standard deprecation cycle,
longer ideally).

Peter



More information about the Biopython-dev mailing list