Skip to content

Commit

Permalink
Update dict clear error kind
Browse files Browse the repository at this point in the history
  • Loading branch information
vsakkas committed Nov 20, 2020
1 parent 72f73d5 commit db962b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mypyc/primitives/dict_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
arg_types=[dict_rprimitive],
return_type=void_rtype,
c_function_name='CPyDict_Clear',
error_kind=ERR_NEVER)
error_kind=ERR_MAGIC)

# list(dict.keys())
dict_keys_op = custom_op(
Expand Down
1 change: 1 addition & 0 deletions mypyc/test-data/run-dicts.test
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ assert get_content(od) == ([3, 1], [4, 2], [(3, 4), (1, 2)])
assert get_content_set({1: 2}) == ({1}, {2}, {(1, 2)})
assert get_content_set(od) == ({1, 3}, {2, 4}, {(1, 2), (3, 4)})

from collections import defaultdict
d = {'a': 1, 'b': 2}
d.clear()
assert d == {}
Expand Down

0 comments on commit db962b8

Please sign in to comment.