|
|
|
|
|
by Niksko
3743 days ago
|
|
That seems a little harsh. Nested list comprehensions with multiple filtering if statements? Scald away. But the simpler examples there are perfectly readable, understandable and maintainable if you understand list comprehensions. And if you need to alter it to the point where it needs to be a little more verbose in order to convey what you're doing, then sure, you can break it out into some other structure. But just because the complexity might increase later on doesn't mean that you shouldn't use a list comprehension. |
|
And for those few lines of code you've traded the ability for new programmers to understand it easily. To me that's a net loss.