Bill Baxter:
> The rationale for .empty is that .length could be an O(n) operation
> for some containers, but .empty should always be O(1).  So, the
> negation of  .length is not a general replacement for .empty.

I didn't know isEmpty() or opBool() must be O(1).
But I remember Andrei (and maybe other people too) strongly refuse my len() 
function that sometimes returns length (in O(1)) and sometimes iterates all 
items of a lazy iterable and returns their number in O(n) or more. So you may 
be wrong.

Bye,
bearophile

Reply via email to