2 ms·
> All the "for x in blah" can seem like a lot of boilerplate for a non-Pythonista It's not the boilerplate that's the problem, it's that using the same constru
by matsemann 5y ago
> All the "for x in blah" can seem like a lot of boilerplate for a non-Pythonista
It's not the boilerplate that's the problem, it's that using the same construct for everything doesn't convey its intention.
If I see a chain of filter, map, group etc., I instantly know what each part does. I know that filter does a filtering, and then I can look at the function passed to it do know how exactly it's filtering. If I see a list comprehension, I have to first understand if it's filtering or mapping or whatever (or even all at once), before I can grok it.