示例#1
0
 def __eq__(self, other):
     if not sequence_tools.is_immutable_sequence(other):
         return False
     for i, j in itertools.zip_longest(self, other, fillvalue=_SENTINEL):
         if (i is _SENTINEL) or (j is _SENTINEL):
             return False
         if i != j:
             return False
     return True
示例#2
0
 def __eq__(self, other):
     if not sequence_tools.is_immutable_sequence(other):
         return False
     for i, j in itertools.izip_longest(self, other, fillvalue=_SENTINEL):
         if (i is _SENTINEL) or (j is _SENTINEL):
             return False
         if i != j:
             return False
     return True
def test_immutable_sequence():
    '''Test that `LazyTuple` is considered an immutable sequence.'''
    assert sequence_tools.is_immutable_sequence(LazyTuple([1, 2, 3]))
示例#4
0
def test_immutable_sequence():
    '''Test that `LazyTuple` is considered an immutable sequence.'''
    assert sequence_tools.is_immutable_sequence(LazyTuple([1, 2, 3]))