4 ms·
A couple things here I don't understand: > if iter(data) is data: Wouldn't it be cheaper like `if type(data) is iter:`? And why convert `data` to a list at a
by abecedarius 5y ago
A couple things here I don't understand:
> if iter(data) is data:
Wouldn't it be cheaper like `if type(data) is iter:`?
And why convert `data` to a list at all, to check for length 0, given that `_sum(data)` will return the count?
- turndown 5y agoPerhaps it's cheaper to just get the conversion and length check out of the way rather than have to execute _sum and find out from checking T.
- abecedarius 5y agoBut the path where the cost of _sum is extra is the error path; plus that'll end up being 0 iterations anyway.