list comprehensions whats happening here
Greg Ewing
see at my.signature
Fri Apr 20 01:13:52 EDT 2001
Carlos Ribeiro wrote:
>
> At 22:14 13/04/01 -0400, Terry Reedy wrote:
> >[[0,j] for j in ('a','b','c')] is much cleaner and faster. Methinks
> >turning a constant into a pseudovariable is the wrong way to go.
>
> I apologize for wasting bandwidth
> when a *much* better idiom is already available.
It is, however, an interesting way of introducing a
"local variable" binding in the middle of a list
comprehension.
Not that I'd recommend it as a clear programming
practice, though!
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list