what is the best way to turn a list into bool value? I am looking for something like:
return eval_bool(my_list)
I have a custom container i
If len(my_list) == 0 it is returned as false, otherwise it is true. It is completely pythonic to write:
len(my_list) == 0
false
true
return len(my_list)
which although it is returned as an integer, evaluates as true for non zero lengths, and false otherwise.