[Biopython-dev] Changing Seq equality

Peter biopython at maubp.freeserve.co.uk
Wed Nov 25 14:15:41 UTC 2009


On Wed, Nov 25, 2009 at 1:15 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>
> In the mean time, I'll work on a patch to do my suggestion of
> hashing and comparison based on string comparison, but with
> alphabet aware warnings.
>

Branch:
http://github.com/peterjc/biopython/tree/seq-comparisons

Commit:
http://github.com/peterjc/biopython/commit/e7859d47a4a1b873b307d5c2db622d335957a6ed

You'll see some basic examples at the top of Bio/Seq.py as module level
docstring doctests, including dictionary and set demonstrations. As I hope
this demonstrates, even this simple rule (Seq comparison follows strings,
but with incompatible alphabets giving warnings) leads to some "odd"
results - but that is just the way Python works (see the int/float examples
in the doctests using dicts and sets).

Note that we may want to do something (on the trunk) about warnings
in doctests (e.g. force them to print to stdout so they can be included in
doctests explicitly).

Other than that, all the other unit tests seem fine (including the BioSQL
tests which is important and they use Seq object subclasses).

Peter



More information about the Biopython-dev mailing list