[Biopython-dev] MutableSeq and array problem

Brad Chapman chapmanb at arches.uga.edu
Sat Feb 3 16:15:00 EST 2001


Hello all;
Just a quick one. In the constructor for MutableSeq, it seems like the 
array function is intialized in a way that python doesn't like. I just 
picked this up recently after moving to the 2.1 alpha releases, so it
might be that new versions are checking more carefully or something.

At any rate, this is a proposed patch for Seq.py, which seems to fix
this. As far as I can tell this seems to be backcompatible with other
versions and consistent with the documentation for the array
constructor. 

Just a one liner, but I wanted to post it here to make sure I was
thinking about this right.

Brad

[Bio]$ diff -c Seq.py.orig Seq.py
*** Seq.py.orig	Sat Sep  9 15:19:18 2000
--- Seq.py	Sat Feb  3 15:42:39 2001
***************
*** 60,66 ****
  class MutableSeq:
      def __init__(self, data, alphabet = Alphabet.generic_alphabet):
          if type(data) == type(""):
!             self.data = array.array( ("c", data) )
          else:
              self.data = data   # assumes the input is an array
          self.alphabet = alphabet
--- 60,66 ----
  class MutableSeq:
      def __init__(self, data, alphabet = Alphabet.generic_alphabet):
          if type(data) == type(""):
!             self.data = array.array("c", data)
          else:
              self.data = data   # assumes the input is an array
          self.alphabet = alphabet






More information about the Biopython-dev mailing list