After I answered that question, it dawned on me that I have probably
written something like that loop, or variations of it, a thousand times:
for obj in somelist: if comparison(obj, needle): do_something(obj) break
Why not just this (by object, not by its index, but that seems simpler):
do_something(next(filter(pred, somelist))) Something about 55 somelist [3, 4, 29, 23, 46, 55, 90, 81] pred
My style works on general iterables, including infinite ones (that hopefully eventually have something fulfilling pred()). -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.