Look how unreadable it is. This is the main reason to avoid list comprehension because it makes code hard to read for humans.
No, you should not avoid list comprehensions, you should avoid unreadable code! That's quite a difference.
I agree. We can definitely use list comprehension to make out code look short and beautiful but complex logic in a list comprehension must be avoided.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Look how unreadable it is. This is the main reason to avoid list comprehension because it makes code hard to read for humans.
No, you should not avoid list comprehensions, you should avoid unreadable code! That's quite a difference.
I agree. We can definitely use list comprehension to make out code look short and beautiful but complex logic in a list comprehension must be avoided.