PEP 315: Enhanced While Loop

Terry Reedy tjreedy at udel.edu
Sun May 4 14:11:24 EDT 2003


"Francis Avila" <francisgavila at yahoo.com> wrote in message
news:vbajd67kf4rs51 at corp.supernews.com...
....
> The only difference between this *current* syntax and the syntax I
proposed
> is that this makes explicit what I made implicit. But, as the wise
ones say,
> "Explicit is better than implicit."[1] Therefore the current syntax
is
> better than the syntax I proposed.  In fact, 'if not <condition>' is
simply
> a shorthand for 'if <condition>: ... else: break'!

My main objection to the current idiom is that it does not visually
separate the preparation and processing parts of the loop -- unless
one trains oneself to more readily 'see' the 'if not: break' as a
break between them.  The unshorthad version, with at most one more
word, does this by indenting the process part more than the prep..  I
think I will give it a try.  In the meanwhile, I am -1 on the PEP.

Terry J. Reedy






More information about the Python-list mailing list