[BioPython] More string methods for the Seq object

Peter biopython at maubp.freeserve.co.uk
Mon Sep 29 11:50:21 UTC 2008


>> No one has objected to adding strip and split (plus lstrip and rstrip)
>> so if we take that as a consensus, the only point we should still
>> debate is their default arguments.  Other alternatives to what I have
>> already put forward include following the python string and defaulting
>> to white space (which would never normally be present in a sequence),
>> or making the arguments non optional.

Listing out those explicitly, for the poposed Seq object methods:
(a) strip, lstrip and rstrip default to the gap character.  split
argument is mandatory.
(b) strip, lstrip, rstrip and split all default to white space
(following string default)
(c) strip, lstrip, rstrip and split all have a mandatory argument
(explicit better than implicit)

> I do agree especially in terms of attempting to keep the standard
> Python defaults and behavior.

I assume you are agreeing with what I have now called (b), follow the
string defaults of white space for stipping or splitting (for
consistency, even though this won't typically be useful for
sequences).  On balance this would probably be best from a principle
of consistency and least surprise for the user - I'll update the
patches.

Peter



More information about the Biopython mailing list