[Python-checkins] python/dist/src/Lib/test test_genexps.py,1.1,1.2
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Thu May 20 19:04:16 EDT 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31168
Modified Files:
test_genexps.py
Log Message:
Add a test to verify an early call to iter() on the outermost for
expression.
Index: test_genexps.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_genexps.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_genexps.py 19 May 2004 08:20:09 -0000 1.1
--- test_genexps.py 20 May 2004 23:04:13 -0000 1.2
***************
*** 92,95 ****
--- 92,104 ----
[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
More information about the Python-checkins
mailing list