Skip to content

Commit a31a3a9

Browse files
committed
tests/basics: Add test for dict.fromkeys where arg is a generator.
Improves coverage because it tests the case where the arg does not have a __len__ slot.
1 parent f8b71aa commit a31a3a9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/basics/dict_fromkeys.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
l.sort()
99
print(l)
1010

11+
# argument to fromkeys is a generator
12+
d = dict.fromkeys(i + 1 for i in range(1))
13+
print(d)

0 commit comments

Comments
 (0)