Casting to bool is useless here. A non-empty list will evaluate to True in a condition.