PEP-0315--Enhanced While Loop: An idea for an alternative syntax

Joe Mason joe at notcharles.ca
Wed Feb 18 21:32:24 EST 2004


In article <7x7jyk2hu9.fsf at ruckus.brouhaha.com>, Paul Rubin wrote:
> Gerrit <gerrit at nl.linux.org> writes:
>> > >     while (line := inputFile.readline()):
>> > >         ...
>> > > a lot better.
>> 
>> I disagree. I think it's counter-intuitive to have an assignment inside
>> an expression. Assignments should be statements. Explicit is better than
>> implicit. 
> 
> There's nothing implicit about an assignment expression.

Except the return value.

Joe



More information about the Python-list mailing list