A library approach to the ternary operator
tebeka at cs.bgu.ac.il
Wed Mar 26 11:37:11 CET 2003
> > to be worth using. Having a function name ("select") there gives us
> > something to attach a nice verbose comment to, while the above, since
> > it uses only language primitives, remains obscure.
> Yes, I concur. Moreover, this ternary.py can easily be widely
> spread and popularized, to establish a usage base for 'choose'
> IF people like the approach (I'm not gonna guess if they will) --
> this may help make a case for 'choose' as a built-in, later, if
> and only if people like and use it so much as to warrant that.
One more argument for macros. If we had macros (which I have no idea
how to implement in Python) we could have checked things like that
without touching the core interpreter.
Just a thought.
More information about the Python-list