[Python-checkins] CVS: python/dist/src/Misc NEWS,1.275,1.276

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 15 Oct 2001 08:54:01 -0700


Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv29005

Modified Files:
	NEWS 
Log Message:
Note about fix in list comprehensions.


Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.275
retrieving revision 1.276
diff -C2 -d -r1.275 -r1.276
*** NEWS	2001/10/09 22:39:40	1.275
--- NEWS	2001/10/15 15:53:58	1.276
***************
*** 23,26 ****
--- 23,35 ----
  Core
  
+ - A very subtle syntactical pitfall in list comprehensions was fixed.
+   For example: [a+b for a in 'abc', for b in 'def'].  The comma in
+   this example is a mistake.  Previously, this would silently let 'a'
+   iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
+   'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
+   'bf', 'cd', 'ce', 'cf'].  Now, this is flagged as a syntax error.
+   Note that [a for a in <singleton>] is a convoluted way to say
+   [<singleton>] anyway, so it's not like any expressiveness is lost.
+ 
  - binascii has now two quopri support functions, a2b_qp and b2a_qp.