What is the recommended way to return a boolean for a fuzzy collection in python?

I came across a Python question : What is the best way to check if a pool is empty? on SO.

Now, if I want to return True ( False ) depending on whether the coll collection is non-empty (empty) from a function, what is the recommended way to do this? return not not coll ?

+4
source share
1 answer

you can use

 return bool(coll) 
+12
source

All Articles