Re:Optimizing the any function in python
by detaro on Thursday October 18, 2018 @08:51AM
(#18247857)
So you're artificially building something that's gives you some of the benefit of using a generator expression in a list expression, instead of just using a generator expression?
Re:Optimizing the any function in python
by ospohngellert on Thursday October 18, 2018 @09:05AM
(#18247952)
I wouldn't call it artificially building something, but I suppose yes. I also find this code to be much more readable than generator code. Once you understand the function, all you have to do is pass it a function that returns a boolean.