What's the difference?

Anthony Papillion papillion at gmail.com
Thu Jun 10 16:47:37 EDT 2010


Someone helped me with some code yesterday and I'm trying to
understand it. The way they wrote it was

subjects = (info[2] for info in items)

Perhaps I'm not truly understanding what this does. Does this do
anything different than if I wrote

for info[2] in items
   subject = info[2]

Thanks!
Anthony



More information about the Python-list mailing list