Return the first match for a condition without going through the whole list using a generator, because expressions
next((x for x in xs if x.y == 10), None)
# equivalent to
for x in xs:
if x.y ==10:
return x
# if there are side effects, they get executed since it goes through the list until the first match