Ulrich Eckhardt wrote:
> Hi!
>
> I'm looking for a way to write code similar to this C code:
>
>   while(rq = get_request(..)) {
>      handle_request(rq);
>   }
>
> Currently I'm doing
>
>   while True:
>       rq = get_request(...)
>       if not rq:
>           break
>       handle_request(rq)
>
> in Python 2.6. Any suggestions how to rewrite that?
>

This is the common idiom.

--
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to