Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update dict_ops.py
  • Loading branch information
BobTheBuidler authored Aug 14, 2025
commit cc150e988719c8365124c5ce5c1dbcd7308b6cdb
15 changes: 8 additions & 7 deletions mypyc/primitives/dict_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ERR_NEG_INT,
binary_op,
custom_op,
custom_primitive_op,
function_op,
load_address_op,
method_op,
Expand Down Expand Up @@ -90,20 +91,20 @@
)

# dict[key] = value
# NOTE: this is currently for internal use only, and not used for CallExpr specialization
exact_dict_set_item_op = custom_op(
dict_set_item_op = method_op(
name="__setitem__",
arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],
return_type=c_int_rprimitive,
c_function_name="PyDict_SetItem",
c_function_name="CPyDict_SetItem",
error_kind=ERR_NEG_INT,
)

# dictorsubclass[key] = value
dict_set_item_op = method_op(
name="__setitem__",
# dict[key] = value (exact dict only, no subclasses)
# NOTE: this is currently for internal use only, and not used for CallExpr specialization
exact_dict_set_item_op = custom_op(
arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],
return_type=c_int_rprimitive,
c_function_name="CPyDict_SetItem",
c_function_name="PyDict_SetItem",
error_kind=ERR_NEG_INT,
)

Expand Down
Loading