[email protected]:
> Marko Rauhamaa <[email protected]> wrote:
>> Chris Angelico <[email protected]>:
>>
>> > You could deduplicate it by shifting the condition:
>> >
>> > while True:
>> > value = get_some_value()
>> > if value not in undesired_values: break
>> >
>> > But I'm not sure how common this idiom actually is.
>>
>> Extremely common, and not only in Python.
>>
> It's the classic C 'for' loop.
It's the classic:
for (;;) {
...
if (...)
break;
...
}
Marko
--
https://mail.python.org/mailman/listinfo/python-list