[BioPython] what should I do next?

Andrew Dalke dalke@acm.org
Mon, 17 Apr 2000 03:09:51 -0600


Cayte:
> Somehow, I'm not finding the Alphabet file.  It's imported by
> files in the distribution, but I can't find the source.


Brad:
>    The Alphabet class and friends are secretly hidden in the 
>__init__.py file in the Alphabet directory (at least in 
>Bio-0.1-d4.tar.gz, I can't connect to starship right now so I'm not 
>positive if there is a new version). I learned about this trick after 
>I spent forever trying to find some classes in a different 
>distribution.


That is correct.

Sorry about the confusion.  That's a habit I got into from the
PyDaylight code.  When I have a submodule containing a base class
and several subclasses, I place the base class definition in the
__init__.  That's because I don't like do

  from Bio.Alphabet.Alphabet import Alphabet

prefering

  from Bio.Alphabet import Alphabet

However, there is no real consensus on this style.  Some code uses
it, some doesn't.  When Bioreason hired another not-first-time
Python programmer (the other programmers learned Python style from
me, so were, ahem, biased), he hadn't used it before, but thought
it made some sense.  (Are you on this list Mitch?  Am I lying?)

The first time you run into it is confusing, as both of you found
out.  This suggests it's a poor practice.  On the other hand, it's
one of those things which bite you once and then you remember.  It's
the same, I believe, as Perl code, with a Module.pm file and also a
Module/ directory.

                    Andrew
                    dalke@acm.org