X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/296d853cc95fd5bef262248cfe21b507abd26a4f..92089d8842643d8cb8f1541e0908c978894326bd:/pymin/seqtools.py?ds=inline diff --git a/pymin/seqtools.py b/pymin/seqtools.py index d3de929..14941af 100644 --- a/pymin/seqtools.py +++ b/pymin/seqtools.py @@ -39,8 +39,17 @@ class Sequence: r"obj[i] -> object :: Get item with the index i." return self.as_tuple()[i] + def __unicode__(self): + return u'%s%r' % (self.__class__.__name__, self.as_tuple()) + + def __str__(self): + return unicode(self).encode('utf-8') + def __repr__(self): - return '%s%r' % (self.__class__.__name__, self.as_tuple()) + return str(self) + + def __cmp__(self, other): + return cmp(self.as_tuple(), other.as_tuple()) def as_tuple(obj): r"""as_tuple(obj) -> tuple :: Convert objects to tuple.