Remove redundant clauses

For basic datatypes (strings, lists, …), bool(obj) is equivalent to bool(len(obj)).