u/RyanDubois43

When should I avoid using list comprehensions?

I started using list comprehensions in my project, but I feel confused about when they are actually a good fit. I tried to use one for a task that involves checking conditions on nested lists, and now my code is harder to follow. Is there a guideline for when it's better to stick with regular loops instead? I want my code to be readable, but I'm not sure I've got the balance right.

reddit.com
u/RyanDubois43 — 7 days ago