Extension of while syntax
Marko Rauhamaa
marko at pacujo.net
Fri Dec 12 05:33:30 EST 2014
More information about the Python-list mailing list
Fri Dec 12 05:33:30 EST 2014
- Previous message (by thread): Extension of while syntax
- Next message (by thread): Extension of while syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
cl at isbd.net: > Marko Rauhamaa <marko at pacujo.net> wrote: >> Chris Angelico <rosuav at gmail.com>: >> >> > 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
- Previous message (by thread): Extension of while syntax
- Next message (by thread): Extension of while syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list