Boolean tests [was Re: Attack a sacred Python Cow]

Terry Reedy tjreedy at
Wed Jul 30 17:07:03 CEST 2008

Carl Banks wrote:

> That's not what I was asking for.  I was asking for a use case for "if
> x" that can't be replaced by a simple explicit test.  Your example
> didn't satisfy that.

But I believe my example of an iterator with __bool__ but not with 
__len__ does.

More information about the Python-list mailing list