@@ -49,20 +49,20 @@ def emit_new(emitter: EmitterInterface, args: List[str], dest: str) -> None:
4949
5050
5151# list[index] (for an integer index)
52- list_get_item_op = method_op (
52+ list_get_item_op = c_method_op (
5353 name = '__getitem__' ,
5454 arg_types = [list_rprimitive , int_rprimitive ],
55- result_type = object_rprimitive ,
56- error_kind = ERR_MAGIC ,
57- emit = call_emit ( 'CPyList_GetItem' ) )
55+ return_type = object_rprimitive ,
56+ c_function_name = 'CPyList_GetItem' ,
57+ error_kind = ERR_MAGIC )
5858
5959# Version with no int bounds check for when it is known to be short
60- method_op (
60+ c_method_op (
6161 name = '__getitem__' ,
6262 arg_types = [list_rprimitive , short_int_rprimitive ],
63- result_type = object_rprimitive ,
63+ return_type = object_rprimitive ,
64+ c_function_name = 'CPyList_GetItemShort' ,
6465 error_kind = ERR_MAGIC ,
65- emit = call_emit ('CPyList_GetItemShort' ),
6666 priority = 2 )
6767
6868# This is unsafe because it assumes that the index is a non-negative short integer
@@ -76,13 +76,13 @@ def emit_new(emitter: EmitterInterface, args: List[str], dest: str) -> None:
7676 emit = call_emit ('CPyList_GetItemUnsafe' ))
7777
7878# list[index] = obj
79- list_set_item_op = method_op (
79+ list_set_item_op = c_method_op (
8080 name = '__setitem__' ,
8181 arg_types = [list_rprimitive , int_rprimitive , object_rprimitive ],
82- steals = [ False , False , True ] ,
83- result_type = bool_rprimitive ,
82+ return_type = bool_rprimitive ,
83+ c_function_name = 'CPyList_SetItem' ,
8484 error_kind = ERR_FALSE ,
85- emit = call_emit ( 'CPyList_SetItem' ) )
85+ steals = [ False , False , True ] )
8686
8787# list.append(obj)
8888list_append_op = method_op (
@@ -101,20 +101,20 @@ def emit_new(emitter: EmitterInterface, args: List[str], dest: str) -> None:
101101 emit = call_emit ('CPyList_Extend' ))
102102
103103# list.pop()
104- list_pop_last = method_op (
104+ list_pop_last = c_method_op (
105105 name = 'pop' ,
106106 arg_types = [list_rprimitive ],
107- result_type = object_rprimitive ,
108- error_kind = ERR_MAGIC ,
109- emit = call_emit ( 'CPyList_PopLast' ) )
107+ return_type = object_rprimitive ,
108+ c_function_name = 'CPyList_PopLast' ,
109+ error_kind = ERR_MAGIC )
110110
111111# list.pop(index)
112- list_pop = method_op (
112+ list_pop = c_method_op (
113113 name = 'pop' ,
114114 arg_types = [list_rprimitive , int_rprimitive ],
115- result_type = object_rprimitive ,
116- error_kind = ERR_MAGIC ,
117- emit = call_emit ( 'CPyList_Pop' ) )
115+ return_type = object_rprimitive ,
116+ c_function_name = 'CPyList_Pop' ,
117+ error_kind = ERR_MAGIC )
118118
119119# list.count(obj)
120120c_method_op (
0 commit comments