Theoretical question about Lambda

holger krekel pyth at devel.trillke.net
Thu May 2 16:17:56 EDT 2002


On Thu, May 02, 2002 at 08:01:35PM +0000, Bengt Richter wrote:
> On Thu, 02 May 2002 17:00:11 GMT, Alex Martelli <aleax at aleax.it> wrote:
> >...while doing it with a def would let you much more easily with
> >an appropriate if/else:
> >
> >if doitoneway:
> >    def foo(): return whatever
> >else:
> >    def foo(): return somethingelse
> >
> What if doitoneway varies during expression evaluation involving foo,
> and whatever and somethingelse involve function calls with side effects?

so what? I don't see the problem and i don't see what a ternary
operator would give you here. I'd like to see ONE code-example
where you think that a ternary operator comes out better than
the functionalities python already provides.

    holger





More information about the Python-list mailing list