[Biopython-dev] Biopython under PyPy

Eric Talevich eric.talevich at gmail.com
Sun Sep 25 01:56:07 UTC 2011

On Mon, Sep 19, 2011 at 6:13 PM, Eric Talevich <eric.talevich at gmail.com>wrote:

> On Mon, Sep 19, 2011 at 12:33 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:
>> We're down to these failures,
>> test_CAPS.py
>> test_Pathway.py
>> test_Restriction.py
>> test_SeqIO_index.py - leaking handles
>> I'll look at test_SeqIO_index.py a bit more, but the others
>> are more curious. They could indicate some fragile code
>> in Biopython which is implementation specific, or perhaps
>> they hit a bug in PyPy. Is anyone interested in finding out?
>> Otherwise we can skip them for now, so that the whole
>> test suite passes, and get PyPy added to the BuildBot
>> for nightly regression testing.
> I could take a look at test_Restriction.py this weekend, I think.
I think it could be a bug in PyPy, but I'm not sure.

The underlying error in test_Restriction and test_CAPS is triggered by
"import Bio.Restriction.Restriction":

    super(RestrictionType, cls).__init__(cls, name, bases, dct)
TypeError: unbound method __init__() must be called with BssMI instance as
first argument (got RestrictionType instance instead)

Adding a print statement before the failing line:

        print cls, name, isinstance(cls, RestrictionType)
        super(RestrictionType, cls).__init__(cls, name, bases, dct)


BssMI BssMI True
[the same error...]

I'm not even sure how to turn this into a simple test case for the PyPy
folks to look at. Anyone else want to take a crack at it? The fun starts
near the bottom of Bio/Restriction/Restriction.py -- search for the word

"We live on a placid island of ignorance in the midst of black seas of
infinity, and it was not meant that we should voyage far. The sciences, each
straining in its own direction, have hitherto harmed us little; but some day
the piecing together of dissociated knowledge will open up such terrifying
vistas of reality, and of our frightful position therein, that we shall
either go mad from the revelation or flee from the light into the peace and
safety of a new dark age."
-- H.P. Lovecraft, The Call of Cthulhu

All the best,

More information about the Biopython-dev mailing list