Skip to content

Commit db962b8

Browse files
committed
Update dict clear error kind
1 parent 72f73d5 commit db962b8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mypyc/primitives/dict_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
arg_types=[dict_rprimitive],
149149
return_type=void_rtype,
150150
c_function_name='CPyDict_Clear',
151-
error_kind=ERR_NEVER)
151+
error_kind=ERR_MAGIC)
152152

153153
# list(dict.keys())
154154
dict_keys_op = custom_op(

mypyc/test-data/run-dicts.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ assert get_content(od) == ([3, 1], [4, 2], [(3, 4), (1, 2)])
9292
assert get_content_set({1: 2}) == ({1}, {2}, {(1, 2)})
9393
assert get_content_set(od) == ({1, 3}, {2, 4}, {(1, 2), (3, 4)})
9494

95+
from collections import defaultdict
9596
d = {'a': 1, 'b': 2}
9697
d.clear()
9798
assert d == {}

0 commit comments

Comments
 (0)