On 5/1/07, Dotan Cohen <[EMAIL PROTECTED]> wrote:

[snip]
>
> List comprehensions are the best thing ever!
>
> Happy to help,
> Ben
>


With Gmail one must be careful and check that the To and Subject
fields contain what you'd expect.

Does 'list comprehension' mean a detailed explanation of the code? If
so, then I'll be reading a lot of them in the near future. I really do
appreciate the dedication and attention to detail. Thanks.



List comprehension are a python/programming term.  They allow one to make a
list without generating a blank one and appending to it. A very basic
example:

newlist = [item for item in spam(eggs)]

is the same as

newlist = []
for item in spam(eggs):
   newlist.append(item)

If you walk through the code from earlier, you can see where a list
comprehension saved some lines and made the flow easier to read.

Official documentation is here: http://docs.python.org/tut/node7.html(section
5.1.4)
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to