collection = some_method_return() filtered = [] for item in collection: if item.property + item.another > 10: filtered.append(item) return filtered.sort()