[Biopython-dev] test_AlignIO to python 3

Tiago Antão tiagoantao at gmail.com
Mon Jul 5 11:13:50 UTC 2010


Hi,

2010/7/5 Peter Cock <p.j.a.cock at googlemail.com>:
> I think Python 2.4 added support for the key argument, so can we
> just unconditionally change it to:
>
> possible.sort(key=lambda x:self.ambiguous_protein[x])
>
> However, that isn't doing quite the same thing. The old sort was by
> table length first to try and get the least ambiguous mapping or
> something like that... we probably need some more unit tests first.

erm, my mistake
possible.sort(key=lambda x:len(self.ambiguous_protein[x]))

I think this sorts this out?


> This is within our private _maketrans function only? That looks sensible
> but I wonder why 2to3 doesn't handle this on its own.

Because (I think), there are now 2 possible alternatives (one
byte-wise and one string-wise), so 2to3 does not know which to choose.

> Would moving the "import string" into the function help for clarity?

It it is only used there, maybe it makes sense.

>> 3. The big one: No sgmllib in p3.
>>   The obvious solution is to include it (I suppose the licenses are
>> compatible?). The alternative (using htmllib) might be more long-term,
>> in my opinion
>
> A lot of the things using sgmllib are already deprecated (e.g.
> Bio.NetCatch and Bio.Prosite). I think that leaves just Bio.UniGene
> and Bio.InterPro - which isn't such a big issue.

I know very little about those parts of the code, but there was an
import required for sgmllib in test_AlignIO.

Tiago


-- 
"If you want to get laid, go to college.  If you want an education, go
to the library." - Frank Zappa




More information about the Biopython-dev mailing list