extend for loop syntax with if expr like listcomp&genexp ?

Bengt Richter bokr at oz.net
Mon Jul 11 19:49:05 EDT 2005


E.g., so we could write

    for x in seq if x is not None:
        print repr(x), "isn't None ;-)"

instead of

    for x in (x for x in seq if x is not None):
        print repr(x), "isn't None ;-)"

just a thought.

Regards,
Bengt Richter



More information about the Python-list mailing list