2 ms·
That's an obscure/not optimal way to write this code though. I mean why would you use LIST comprehension if you are going to yield each element.
by planetis 5y ago
That's an obscure/not optimal way to write this code though. I mean why would you use LIST comprehension if you are going to yield each element.
- nerdponx 5y agoIt's not list comprehension, it's generator comprehension, which is lazily computed. However it's still an unnecessary layer of iteration, when you could just return the comprehension instead.