def find_match():
for x in range(max_x):
for y in range(max_y):
if match(x, y):
return x, y
result = find_match()
if result is None:
# match not found
else:
x, y = result
Yup, looks clean to me, and the named "result" and "inner_function" give the opportunity for self-documentation, with appropriate names instead of "result" and "inner_function".
Image by mikebaird via Flickr
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=d78f5b3e-d7ba-4039-af20-f76824602f1c)
No comments:
Post a Comment