[Biopython-dev] Changing Seq equality
Peter
biopython at maubp.freeserve.co.uk
Fri Nov 27 11:39:41 UTC 2009
On Thu, Nov 26, 2009 at 8:13 PM, Eric Talevich <eric.talevich at gmail.com> wrote:
>
> I guess this is the basic question: is a Seq a string-type, or complex
> class that contains a string (is-a vs. has-a)? Python will let us be
> inconsistent with the type system if want, but for a class as
> fundamental as Seq, I think it should be consistent.
>
> Biopython-dev discussed making Seq inherit from str or basestring
> earlier [1], and I think it was decided that while actual inheritance
> would be tricky, Seq should mimic that interface as much as possible
> (using the alphabet attribute for validation and extra features,
> mainly). So we'd treat Seq as a string-like type -- option (b) -- and
> let SeqRecord be the complex type that has a sequence, accession
> number, location, etc., where object identity is the only valid case
> for equality.
>
> In short: +1 for your patch on GitHub; I think the rationale is solid.
>
> -Eric
>
> [1] http://bugzilla.open-bio.org/show_bug.cgi?id=2351#c6
Nicely put.
Peter
More information about the Biopython-dev
mailing list