News for hackers. Stuff that matters.
Re:Optimizing the any function in python by ospohngellert on Thursday October 18, 2018 @09:29AM (#18248114)
The first one is clearly easier to read than the second. However the first one is slow. I believe fast_any is easier to read than generator code.
Re:Optimizing the any function in python by ospohngellert on Thursday October 18, 2018 @09:32AM (#18248132)
Actually, apologies I see now. I always associated generator's with the `yields` keyword, but maybe I have to look into them again. Thanks!
Re:Optimizing the any function in python by detaro on Thursday October 18, 2018 @09:31AM (#18248124)
The first IS generator code. That's a generator expression, note that it does not have the [] of a list expression.