[Biopython-dev] Bio.Restriction "super" call (Python vs PyPy?)

Eric Talevich eric.talevich at gmail.com
Sat Nov 26 14:49:35 EST 2011


On Sat, Nov 26, 2011 at 8:38 AM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Saturday, November 26, 2011, Eric Talevich <eric.talevich at gmail.com>
> wrote:
> > On Fri, Nov 25, 2011 at 8:24 PM, Brad Chapman <chapmanb at 50mail.com>
> wrote:
> >>
> >> Peter;
> >>
> >> > >> super(RestrictionType, cls).__init__(cls, name, bases, dct)
> >> > >
> >> > > That seems strange: the __init__ is calling super on itself. You'd
> >> > > normally expect this from a derived class. I'm not sure why this
> >> > > doesn't trigger an infinite recursion initializing the object. I'm
> +1
> >> > > on commenting it out.
> >>
> >> > I suppose we could be cautious and skip that line under PyPy
> >> > only. How about that as a compromise - that way if is really
> >> > is important for something not covered in the unit test, we only
> >> > break it under PyPy, but C Python and Jython would be fine?
> >>
> >> My vote would be to comment it out generally instead of if_pypy
> >> flags. I don't want to break anything, but if we do I'd rather find out
> >> straight away instead of chasing down platform specific bugs later. I'd
> >> be happy to hear other's opinions, especially if they ynderstand the
> >> super magic going on.
> >>
> >
> > I support that, and maybe we can add some more unit tests to
> > see if we can find out what breaks, if anything.
>
> OK
>
>
> > Looking at the Bio/Restriction/Restriction.py, I can suggest these
> > candidates:
>
> Great - do you want to try to turn those into unit tests?
>
>
Sure thing. Here's the relevant commit:
https://github.com/biopython/biopython/commit/eb1c163909801731dc0a3d7fbcb2ee514f212da3

Unit tests for most of the magic methods were already there, I just didn't
notice them earlier.

I also commented out the offending line in Restriction.py and stirred the
code a bit in that file and in the test suite. I tested with Python 2.7 and
Pypy 1.7 on Ubuntu; we'll see what the build bots say now.

-Eric


More information about the Biopython-dev mailing list