Nicolas Fleury <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > Why are you so excited about having until indented? You didn't give
> > any examples with multiple occurrences. A single occurrence works just
> > fine unindented, as PEP 315 has already shown.
> 
> FWIW, I must say I disagree (about "works just fine").  I find PEP 315 
> counter-intuitive.  There's multi-part blocks in Python, but they all 
> behave like a step-sequence where you never come back to a previous 
> step.  What I mean is that after entering a finally/except/elif/else, 
> there's no coming back in the try/if/for/while.  My first impression 
> when looking at:
> 
> do:
>      <block1>
> while condition:
>      <block2>
> 
> is that <block1> is executed only once. 

Indeed.  The original poster seems to want something that would work (not
necessarily look) like this:

  do:
      <block>
  while <condition>

with <block> executed once prior to <condition> first being tested.  But the
above is ugly, and you can get much the same effect with Python today:

  firsttime = True
  while firsttime or <condition>:
      <block>
      firsttime = False

Seems fairly Pythonic to me.  YMMV.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                           <[EMAIL PROTECTED]>
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to