Comment by zardeh

10 years ago

Its important to read that line in context:

>There should be one-- and preferably only one --obvious way to do it.

The zen of python isn't saying "only have one way to do anything" it says "have at least one obvious way, and preferably only one obvious way to do this".

There can be lots of ways to iterate over a list:

    [x for x in l]

    for x in l:
        x

    while (x for x in [1,2,3]).next():
        ...

Only one is obvious for a given situation.