idiomatic analogue of Perl's: while (<>) { ... }

Sahil Tandon sahil at FreeBSD.org
Fri Sep 2 15:56:46 EDT 2011


Dennis Lee Bieber wrote:
> On Thu, 1 Sep 2011 00:56:50 -0400, Sahil Tandon<sahil at FreeBSD.org>
>> # process input, line-by-line, and print responses after parsing input
>> while 1:
>>    rval = parse(raw_input())
>>    if rval == None:
>
> 	There is only ONE "None" object so the preferred method is
>
> 	if rval is None:

Understood; thanks for that enlightenment.

> 	Note: I don't see any exit handler/condition...

Indeed.  I excluded such things in the interest of brevity, to focus the 
discussion on my question. :)

-- 
Sahil Tandon <sahil at FreeBSD.org>




More information about the Python-list mailing list