3 ms·
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
by jasonhansel 4y ago
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)