示例#1
0
 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
示例#2
0
 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
示例#3
0
 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]
示例#4
0
 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)
示例#5
0
 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
示例#6
0
 def foo(i):
     l = listobject.new_list(int32)
     return l.count(i)
示例#7
0
 def foo(n):
     l = listobject.new_list(int32)
     l.append(n)
     return l[-1]
示例#8
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     # slice with a non-{integer,slice}
     l[i] = 1
示例#9
0
 def foo():
     l = listobject.new_list(int32)
     l.append(0)
     l.remove(0)
     return len(l)
示例#10
0
 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]
示例#11
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     l.insert(i, 1)
     return len(l), l[0], l[1]
示例#12
0
 def foo(items):
     l = listobject.new_list(int32)
     l.extend(items)
     return len(l)
示例#13
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     # slice with a non-{integer,slice}
     return l.pop(i)
示例#14
0
 def foo(i):
     l = listobject.new_list(int32)
     for j in (10, 11, 12):
         l.append(j)
     l.pop(i)
示例#15
0
 def foo(i):
     l = listobject.new_list(int32)
     l.pop(i)
示例#16
0
 def foo(i):
     l = listobject.new_list(int32)
     for j in (10, 11, 12):
         l.append(j)
     return l.pop(i), len(l)
示例#17
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     return l.pop(i), len(l)
示例#18
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     l[i] = 1
     return l[i]
示例#19
0
 def foo():
     l = listobject.new_list(int32)
     l.append(0)
     # assign a non-iterable to a slice
     l[:] = 1
示例#20
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(10)
     return l.count(i)
示例#21
0
 def foo(i):
     l = listobject.new_list(int32)
     for j in [11, 12, 12, 13, 13, 13]:
         l.append(j)
     return l.count(i)
示例#22
0
 def foo():
     l = listobject.new_list(int32)
     l.append(0)
     del l[0:1:1]
     return len(l)
示例#23
0
 def foo():
     l = listobject.new_list(int32)
     l.extend(1)
示例#24
0
 def foo():
     l = listobject.new_list(int32)
     for j in (10, 11, 12):
         l.append(j)
     del l[:]
     return len(l)
示例#25
0
 def foo(i):
     l = listobject.new_list(int32)
     for j in range(10, 20):
         l.append(j)
     return l[i]
示例#26
0
 def foo(i):
     l = listobject.new_list(int32)
     return i in l
示例#27
0
 def foo():
     l = listobject.new_list(int32)
     l.insert("a", 0)
示例#28
0
 def foo(i):
     l = listobject.new_list(int32)
     l.append(0)
     return i in l
示例#29
0
 def foo():
     l = listobject.new_list(int32)
     l.append(1)
     l.remove(0)
示例#30
0
 def boxer():
     l = listobject.new_list(int32)
     for i in range(10, 20):
         l.append(i)
     return listobject._as_meminfo(l)