Vote on PEP 308: Ternary Operator
Jack D. Hammer
thisisabogusemail at bogus.thisisabogusdomain.com
Tue Mar 4 13:04:42 EST 2003
I will vote no ternary operator.
I have not run in to a case where it is needed yet. I don't think that there
is any reason to make reading code more complicated. If the user really want
to do this, then they can always define their own function that takes three
paramters.
def foo(booleanTest, condition1, condition2):
if booleanTest:
return condition1
return condition2
def foo2:
...
a = foo(someTest, condition1, condition2)
...
I don't like a line serving two purposes, which a ternary would introduce.
More information about the Python-list
mailing list