Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wouldn't you just write:

  found = next((
    (r, c)
    for r, row in enumerate(rows)
    for c, cell in enumerate(row)
    if search_query.matches(cell.value)
  ), None)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: