diff options
| author | Raymond Hettinger <python@rcn.com> | 2004-05-20 23:04:13 (GMT) | 
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2004-05-20 23:04:13 (GMT) | 
| commit | 83ee79524ae6462b7b044bb9cf2f625231814dba (patch) | |
| tree | b38a10b38e59789a6dc7c99d7312b97a5cd319d4 | |
| parent | 956e4f792fbaea5aca938d6ed0d66bdc7c7e401b (diff) | |
| download | cpython-83ee79524ae6462b7b044bb9cf2f625231814dba.zip cpython-83ee79524ae6462b7b044bb9cf2f625231814dba.tar.gz cpython-83ee79524ae6462b7b044bb9cf2f625231814dba.tar.bz2 | |
Add a test to verify an early call to iter() on the outermost for
expression.
| -rw-r--r-- | Lib/test/test_genexps.py | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index b09fc95..31e133f 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -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) | 
