Skip to content

Commit cc150e9

Browse files
Update dict_ops.py
1 parent b13528a commit cc150e9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mypyc/primitives/dict_ops.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
ERR_NEG_INT,
2020
binary_op,
2121
custom_op,
22+
custom_primitive_op,
2223
function_op,
2324
load_address_op,
2425
method_op,
@@ -90,20 +91,20 @@
9091
)
9192

9293
# dict[key] = value
93-
# NOTE: this is currently for internal use only, and not used for CallExpr specialization
94-
exact_dict_set_item_op = custom_op(
94+
dict_set_item_op = method_op(
95+
name="__setitem__",
9596
arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],
9697
return_type=c_int_rprimitive,
97-
c_function_name="PyDict_SetItem",
98+
c_function_name="CPyDict_SetItem",
9899
error_kind=ERR_NEG_INT,
99100
)
100101

101-
# dictorsubclass[key] = value
102-
dict_set_item_op = method_op(
103-
name="__setitem__",
102+
# dict[key] = value (exact dict only, no subclasses)
103+
# NOTE: this is currently for internal use only, and not used for CallExpr specialization
104+
exact_dict_set_item_op = custom_op(
104105
arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],
105106
return_type=c_int_rprimitive,
106-
c_function_name="CPyDict_SetItem",
107+
c_function_name="PyDict_SetItem",
107108
error_kind=ERR_NEG_INT,
108109
)
109110

0 commit comments

Comments
 (0)