Beispiel #1
0
def listtest():
    l1 = ImmutableList([2, 3])
    assert l1.conj(1) == [1, 2, 3]
    assert len(l1) == 2
    assert l1.conj(1) == ImmutableList(1, l1)
    l3 = ImmutableList()
    assert len(l3) == 0
    assert l3 == ImmutableList([])
def listtest():
    l1 = ImmutableList([2, 3])
    assert l1.conj(1) == [1, 2, 3]
    assert len(l1) == 2
    assert l1.conj(1) == ImmutableList(1, l1)
    l3 = ImmutableList()
    assert len(l3) == 0
    assert l3 == ImmutableList([])
def typetest():
    l = ImmutableList()
    v = ImmutableVector()
    d = ImmutableDict()

    assert l is not None
    assert v != 3
    assert d != 'a'

    assert l == v
    assert d != v
    assert d != l
Beispiel #4
0
 def __init__(self, *args):
     ImmutableList.__init__(self, args)