2008/4/18, Nicholas T <[EMAIL PROTECTED]>: > Amaury - I think it's generally cleaner code to write > for myObject in someList: > if myObject.fits(): > process(myObject) > break > than > for myObject in someList: > if myObject.fits(): > break > process(myObject)
See, I do this a lot: for a, b, c in someList: if <some condition with a or b>: break else: c = foobar c.something() Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com