[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] [cvs2svn] Code cleanup - Use "for: ... else: ..." to avoid a temporary variable

From: Max Bowsher <maxb_at_ukf.net>
Date: 2003-08-24 16:23:54 CEST

mark benedetto king wrote:
> On Sat, Aug 23, 2003 at 07:03:09PM +0100, Max Bowsher wrote:
>>> Doesn't this change the semantics of the block?
>>
>> No - The behaviour of "for: ... else: ..." is to execute the "else:"
>> unless the loop was exited by "break".
>>
>
> Ah. That explains it. I had jumped to the (wrong) conclusion that
> the else clause was for empty lists.

Understandable. It's not a very obviously named feature.
It helps to think of "for" as "search-for" and "break" as "found-it".

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 24 16:25:08 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.