A gnarly little python loop

Peter Otten __peter__ at web.de
Mon Nov 12 16:49:23 CET 2012


rusi wrote:

> The fidgetiness is entirely due to python not allowing C-style loops
> like these:
> >>> while ((c=getchar()!= EOF) { ... }

for c in iter(getchar, EOF):
    ...

> Clearly the fidgetiness is there as before and now with extra coroutine
> plumbing

Hmm, very funny...




More information about the Python-list mailing list