Defending the ternary operator
Erik Max Francis
max at alcyone.com
Sat Feb 8 15:56:19 EST 2003
More information about the Python-list mailing list
Sat Feb 8 15:56:19 EST 2003
- Previous message (by thread): ternary operator
- Next message (by thread): Defending the ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alexander Schmolck wrote: > True. Still, that doesn't mean that allowing further grammatically > distinct > "if"s wouldn't have a negative impact. The list comprehension "if" at > least is > quite limited: there is no "else" part, you can't chain it and it > occurs in a > fairly narrow context. Introducing an "if" expression would almost > certainly > increase the impact: > > if ...: > y = [i if ... else ... for i if i ...] if ... else ... Yep, language features can be abused. That's true for any language feature in any language. I don't find it a compelling argument, especially in this case where the construct being proposed has the opportunity make code _more_ clear and concise when used properly, not less. -- Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/ __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE / \ Lawyers, I suppose, were children once. \__/ Charles Lamb The laws list / http://www.alcyone.com/max/physics/laws/ Laws, rules, principles, effects, paradoxes, etc. in physics.
- Previous message (by thread): ternary operator
- Next message (by thread): Defending the ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list