question about True values
steve at REMOVE.THIS.cybersource.com.au
Sat Oct 28 13:15:31 CEST 2006
On Sat, 28 Oct 2006 11:42:42 +0200, Marc 'BlackJack' Rintsch wrote:
> 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()
> It works for *this* iterator. By accident.
Blimey, you're right. That can't be good.
In fact, it made a certain BDFL pretty mad:
Okay, so all iterators are intentionally *supposed* to be True, always,
even if they are exhausted. As Guido says, don't treat iterators as
More information about the Python-list