Tom Ritchford
Aug 18, 2023

--

Hear, hear, this is one of the two excellent uses of the walrus, the other being things like:

if results := search(needle, haystack, options):
display_results(results)

In fast company, someone might ever write:

(r := search(needle, haystack, options)) and display_result(r)

but I think readability wins every time.

--

--

Responses (1)