2 ms·
> Of course, the Python function named 'min' could very well implement an infimum in this case, and it would be OK. Using min(∅) = +inf and max(∅) = -inf would
by thaumasiotes 7y ago
> Of course, the Python function named 'min' could very well implement an infimum in this case, and it would be OK.
Using min(∅) = +inf and max(∅) = -inf would violate the otherwise valid constraint that min(x) ≤ max(x). I'd be a little uncomfortable with it for that reason.
> The right choice depends on context.
Definitely.
- eru 7y ago> Using min(∅) = +inf and max(∅) = -inf would violate the otherwise valid constraint that min(x) ≤ max(x). I'd be a little uncomfortable with it for that reason. Excellent point! Funny enough, we have the same with 'any' and 'all': For most lists of booleans: all(l) ≤ any(l). Or equivalently all(l) implies any(l). But that property is broken for empty lists. Hmm, I think I might understand the case for `all([]) == False` a bit better now. Though I still disagree with it.