5 ms·
The author's Python example is a straw man. You can write generator expressions that way... if you hate yourself and all the people who will have to deal with y
by makk 9y ago
The author's Python example is a straw man. You can write generator expressions that way... if you hate yourself and all the people who will have to deal with your code.
The Go alternative that's provided, if that's one's stylistic preference, is just as easily implemented in Python as it is in Go.
To my eyes neither the Go nor the Python implementations in the article are beautiful.
In any case, despite his bagging of Python, it seems like the author would agree with the Zen of Python:
Flat is better than nested.
Sparse is better than dense.
Readability counts.