question about True values

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Oct 28 05:42:42 EDT 2006


In <pan.2006.10.28.07.45.14.198030 at REMOVE.THIS.cybersource.com.au>, Steven
D'Aprano wrote:

> On Fri, 27 Oct 2006 11:25:09 -0700, Carl Banks wrote:
> 
>> Iterators do have overlapping uses with lists, but the "if a:" doesn't
>> work for them, so it's moot.
> 
> Sure it works for iterators.
> 
>>>> it = iter([0])
>>>> bool(it)
> True
>>>> it.next()
> 0
>>>> bool(it)
> False

It works for *this* iterator.  By accident.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list