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

Peter Cock p.j.a.cock at googlemail.com
Fri Nov 25 11:40:49 UTC 2011


On Thu, Nov 24, 2011 at 3:33 PM, Brad Chapman <chapmanb at 50mail.com> wrote:
>
> Peter;
>
>> Aside from a problem with leaking handles,
>
> Is this from tempfile.mkstemp? This has tricked me an annoying number of
> times, so I eventually wrote a wrapper. The trick is doing an os.close
> on the file descriptor:
>
> https://github.com/chapmanb/bcbb/blob/master/nextgen/bcbio/utils.py#L118

Possibly in test_PDB.py but there are other handle leaks.

>> the remaining problem
>> with Biopython's test suite under PyPy is in Bio.Restriction,
>> specifically this line in the RestrictionType class __init__ method,
>>
>> 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.
>
> Brad

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?

Peter



More information about the Biopython-dev mailing list