def foo(): t = listobject.new_list(int32) o = listobject.new_list(int32) for i in range(10): t.append(i) o.append(i) return t == o, t != o
def foo(): l = listobject.new_list(int32) for j in range(10, 20): l.append(j) k = listobject.new_list(int32) for j in range(10, 20): k.append(j) # should be a no-op del l[-9:-20] return k == l
def foo(): l = listobject.new_list(types.unicode_type) l.append('a') l.append('b') l.append('c') l.append('d') return l[0], l[1], l[2], l[3]
def foo(): l = listobject.new_list(int32) for j in range(10, 20): l.append(j) l.remove(13) l.remove(19) return len(l)
def foo(items): l = listobject.new_list(int32) l.extend(items) # use a simple sum to check this w/o having to return a list r = 0 for j in l: r += j return r
def foo(i): l = listobject.new_list(int32) return l.count(i)
def foo(n): l = listobject.new_list(int32) l.append(n) return l[-1]
def foo(i): l = listobject.new_list(int32) l.append(0) # slice with a non-{integer,slice} l[i] = 1
def foo(): l = listobject.new_list(int32) l.append(0) l.remove(0) return len(l)
def foo(i): l = listobject.new_list(int32) for j in range(10): l.append(0) l.insert(i, 1) return len(l), l[10]
def foo(i): l = listobject.new_list(int32) l.append(0) l.insert(i, 1) return len(l), l[0], l[1]
def foo(items): l = listobject.new_list(int32) l.extend(items) return len(l)
def foo(i): l = listobject.new_list(int32) l.append(0) # slice with a non-{integer,slice} return l.pop(i)
def foo(i): l = listobject.new_list(int32) for j in (10, 11, 12): l.append(j) l.pop(i)
def foo(i): l = listobject.new_list(int32) l.pop(i)
def foo(i): l = listobject.new_list(int32) for j in (10, 11, 12): l.append(j) return l.pop(i), len(l)
def foo(i): l = listobject.new_list(int32) l.append(0) return l.pop(i), len(l)
def foo(i): l = listobject.new_list(int32) l.append(0) l[i] = 1 return l[i]
def foo(): l = listobject.new_list(int32) l.append(0) # assign a non-iterable to a slice l[:] = 1
def foo(i): l = listobject.new_list(int32) l.append(10) return l.count(i)
def foo(i): l = listobject.new_list(int32) for j in [11, 12, 12, 13, 13, 13]: l.append(j) return l.count(i)
def foo(): l = listobject.new_list(int32) l.append(0) del l[0:1:1] return len(l)
def foo(): l = listobject.new_list(int32) l.extend(1)
def foo(): l = listobject.new_list(int32) for j in (10, 11, 12): l.append(j) del l[:] return len(l)
def foo(i): l = listobject.new_list(int32) for j in range(10, 20): l.append(j) return l[i]
def foo(i): l = listobject.new_list(int32) return i in l
def foo(): l = listobject.new_list(int32) l.insert("a", 0)
def foo(i): l = listobject.new_list(int32) l.append(0) return i in l
def foo(): l = listobject.new_list(int32) l.append(1) l.remove(0)
def boxer(): l = listobject.new_list(int32) for i in range(10, 20): l.append(i) return listobject._as_meminfo(l)