Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info>:

> So why is it hard to read when the index is a flag?
>
> value = [f, g][cond]()

So, subjectively, which syntax would you prefer:

    if j < 10:
        j += 1
    else:
        j = 3

or:

    j = j + 1 if j < 10 else 3

or:

    j = (lambda: 3, lambda: j + 1)[j < 10]()


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to