mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add a test to verify an early call to iter() on the outermost for
expression.
This commit is contained in:
parent
956e4f792f
commit
83ee79524a
1 changed files with 9 additions and 0 deletions
|
@ -91,6 +91,15 @@ Verify early binding for the outermost for-expression
|
|||
>>> list(g)
|
||||
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
|
||||
|
||||
Verify that the outermost for-expression makes an immediate check
|
||||
for iterability
|
||||
|
||||
>>> (i for i in 6)
|
||||
Traceback (most recent call last):
|
||||
File "<pyshell#4>", line 1, in -toplevel-
|
||||
(i for i in 6)
|
||||
TypeError: iteration over non-sequence
|
||||
|
||||
Verify late binding for the outermost if-expression
|
||||
|
||||
>>> include = (2,4,6,8)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue