PEP308: Proposing function-call syntax

John Roth johnroth at ameritech.net
Mon Feb 10 13:38:16 CET 2003


"Neil Hodgson" <nhodgson at bigpond.net.au> wrote in message
news:vBL1a.9829$Xo.35406 at news-server.bigpond.net.au...
> Anders J. Munch:
>
> >     ifelse(condition, iftrue, iffalse)
> >
> > That is, use plain old function call notation, but with 'ifelse'
being
> > a keyword recognised by the interpreter, so that arguments are only
> > evaluated as necessary.
>
>    I'd like it tobe a completely normal built in function. That allows
> inline use for cases where short circuit evaluation isn't needed.
Those
> cases that need to short circuit use explicit code. No new syntax.

You can do that today. Just add it to any module where you want it,
or shove it into the builtins. The difficulty is that other people
reading the program might expect lazy evaluation, and get hung
up when they update your program.

John Roth


>
>    Neil
>
>






More information about the Python-list mailing list