On 2007-02-16, Bart Ogryczak <[EMAIL PROTECTED]> wrote:
> On Feb 16, 4:30 pm, "stdazi" <[EMAIL PROTECTED]> wrote:
>
>> for (i = 0; some_function() /* or other condition */ ; i++)
>
> C's "for(pre,cond,post) code" is nothing more, then shorthand form of
> "pre; while(cond) {code; post;}"
> Which translated to Python would be:
>
> pre
> while cond:
>   code
>   post

No, when you consider the continue statement, which which Python
also supports.

for (pre; cond; post) {
  continue;
}

That's not an infinite loop in C, but the Python while-loop
version would be.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to