expression form of one-to-many dict?
Alex Martelli
aleaxit at yahoo.com
Wed Dec 22 10:21:18 EST 2004
Mike Meyer <mwm at mired.org> wrote:
> > As in, say, calling
> > x = ternary(c, lambda:t, lambda:f)
> > ? The 'lambda:' is a (not nice-looking, but...) "indication of
> > non-evaluation"... or am I misundertanding what you're saying?
>
> No, you're saying it exactly right. And that does, indeed, do the
> trick. Just a bit ugly is all.
Yeah, there's a PEP to provide alternate, less-ugly syntax sugar for
this specific use of lambda, but I don't think it stands any chance of
passing.
Alex
More information about the Python-list
mailing list