Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/diff/3a34b934435f/allpy/base.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 20:16:18 2013
Кодировка:
allpy: allpy/base.py diff

allpy

diff allpy/base.py @ 316:3a34b934435f

Added allpy.base.Sequence.__hash__: sequences are hashed by identity
author Daniil Alexeyevsky <me.dendik@gmail.com>
date Thu, 16 Dec 2010 23:45:57 +0300
parents fa6bd8d0f175
children c2ff3beb5821
line diff
     1.1 --- a/allpy/base.py	Thu Dec 16 23:43:18 2010 +0300
     1.2 +++ b/allpy/base.py	Thu Dec 16 23:45:57 2010 +0300
     1.3 @@ -165,6 +165,10 @@
     1.4          """Returns sequence in one-letter code."""
     1.5          return ''.join(monomer.code1 for monomer in self)
     1.6  
     1.7 +    def __hash__(self):
     1.8 +        """Hash sequence by identity."""
     1.9 +        return id(self)
    1.10 +
    1.11      @classmethod
    1.12      def from_string(cls, string, name='', description=''):
    1.13          """Create sequences from string of one-letter codes."""