[Python-Dev] comprehension abbreviation

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 15 01:01:37 CET 2005

Eric Nieuwland wrote:
> The full syntax is:
>     [ f(x) for x in seq if pred(x) ]
> being allowed to write 'x' instead of 'identity(x)' is already a 
> shortcut,

That's a really strange way of looking at it. Unless
you would also say that

   x = y

is a shorthand for

   x = identity(y)

Not that it's false, it just seems like a completely
unnecessary layer of mental gymnastics...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list