9 @cython.test_assert_path_exists('//PythonCapiCallNode')
10 @cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode')
13 >>> L = list(range(10))
19 [0, 1, 2, 3, 4, 5, 6, 7]
26 Traceback (most recent call last):
28 IndexError: pop from empty list
35 @cython.test_assert_path_exists('//PythonCapiCallNode')
36 @cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode')
37 def simple_pop_typed(list L):
39 >>> L = list(range(10))
40 >>> simple_pop_typed(L)
42 >>> simple_pop_typed(L)
45 [0, 1, 2, 3, 4, 5, 6, 7]
47 ... _ = simple_pop_typed(L)
51 >>> simple_pop_typed(L)
52 Traceback (most recent call last):
54 IndexError: pop from empty list
59 @cython.test_assert_path_exists('//PythonCapiCallNode')
60 @cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode')
61 def index_pop(L, int i):
63 >>> L = list(range(10))
69 [0, 1, 3, 4, 5, 6, 7, 9]
71 Traceback (most recent call last):
73 IndexError: pop index out of range
74 >>> index_pop(L, -100)
75 Traceback (most recent call last):
77 IndexError: pop index out of range
80 ... _ = index_pop(L, 0)
86 Traceback (most recent call last):
88 IndexError: pop from empty list
95 @cython.test_assert_path_exists('//PythonCapiCallNode')
96 @cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode')
97 def index_pop_typed(list L, int i):
99 >>> L = list(range(10))
100 >>> index_pop_typed(L, 2)
102 >>> index_pop_typed(L, -2)
105 [0, 1, 3, 4, 5, 6, 7, 9]
106 >>> index_pop_typed(L, 100)
107 Traceback (most recent call last):
109 IndexError: pop index out of range
110 >>> index_pop_typed(L, -100)
111 Traceback (most recent call last):
113 IndexError: pop index out of range
116 ... _ = index_pop_typed(L, 0)
121 >>> index_pop_typed(L, 0)
122 Traceback (most recent call last):
124 IndexError: pop from empty list
129 @cython.test_fail_if_path_exists('//PythonCapiCallNode')
132 >>> crazy_pop(list(range(10))) # doctest: +ELLIPSIS
133 Traceback (most recent call last):
134 TypeError: pop... at most 1 argument...3...
138 return L.pop(1, 2, 3)