示例#1
0
文件: bits.py 项目: 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
示例#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