Terry Hancock <[EMAIL PROTECTED]> writes:
> But of course that's not equivalent.  It's hard to imagine a
> use case for an enumerated loop when the object being
> iterated over is anonymous (will be lost as soon as the loop exits).

Huh?  Not at all.

  print 'List of Python fans:'
  for i,x in enumerate([p for p in people if p.favorite_language == 'Python']):
    print '%d. %s'% (i, x.name)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to