Skip to content

Commit 0d47bea

Browse files
committed
Add back genexpr test
1 parent a96a192 commit 0d47bea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_genexps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@
131131
>>> list(g)
132132
[1, 9, 25, 49, 81]
133133
134+
Verify that the outermost for-expression makes an immediate check
135+
for iterability
136+
>>> (i for i in 6)
137+
Traceback (most recent call last):
138+
File "<pyshell#4>", line 1, in -toplevel-
139+
(i for i in 6)
140+
TypeError: 'int' object is not iterable
141+
134142
Verify late binding for the innermost for-expression
135143
136144
>>> g = ((i,j) for i in range(3) for j in range(x))

0 commit comments

Comments
 (0)