See Pep 315. was: Re: Loop until condition is true

John Roth newsgroups at jhrothjr.com
Sun Jun 19 09:11:02 EDT 2005


See Pep 315, which is still open, and targeted at 2.5.
It survived the recent spate of PEP closings and rejections.

http://www.python.org/peps/pep-0315.html

John Roth

"Remi Villatel" <maxilys at SPAMCOP_tele2.fr> wrote in message 
news:d90bej$c0a$1 at news.tiscali.fr...
> Hi there,
>
> There is always a "nice" way to do things in Python but this time I can't 
> find one.
>
> What I'm trying to achieve is a conditionnal loop of which the condition 
> test would be done at the end so the loop is executed at least once. It's 
> some way the opposite of "while".
>
> So far, all I got is:
>
> while True:
> some(code)
> if final_condition is True:
> break
> #
> #
>
> What I don't find so "nice" is to have to build an infinite loop only to 
> break it.
>
> Is there a better recipe?
>
> -- 
> ==================
> Remi Villatel
> maxilys_ at _tele2.fr
> ================== 




More information about the Python-list mailing list