Esempio n. 1
0
File: bits.py Progetto: eblot/pyftdi
 def _cmp(self, other):
     # the bit sequence should be of the same length
     ld = len(self) - len(other)
     if ld:
         return ld
     for n, (x, y) in enumerate(zip(self._seq, other.sequence()), start=1):
         if xor(x, y):
             return n
     return 0
Esempio n. 2
0
 def _cmp(self, other):
     # the bit sequence should be of the same length
     ld = len(self) - len(other)
     if ld:
         return ld
     for n, (x, y) in enumerate(zip(self._seq, other.sequence()), start=1):
         if xor(x, y):
             return n
     return 0