Skip to content

Commit d3672cf

Browse files
committed
Update dict copy tests
1 parent 2bc1a82 commit d3672cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mypyc/test-data/run-dicts.test

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,17 @@ 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 typing import Dict
9596
from collections import defaultdict
9697
d = {}
9798
assert d.copy() == d
9899
d = {'a': 1, 'b': 2}
99100
assert d.copy() == d
100101
assert d.copy() is not d
101-
d = defaultdict(int)
102-
assert d.copy() == d
102+
dd: Dict[str, int] = defaultdict(int)
103+
dd['a'] = 1
104+
assert dd.copy() == dd
105+
assert isinstance(dd.copy(), defaultdict)
103106
[typing fixtures/typing-full.pyi]
104107

105108
[case testDictIterationMethodsRun]

0 commit comments

Comments
 (0)