DEV Community

My case against the "ternary operator" in Python

Victor Silva on May 19, 2019

Ternary what? Ternary operators, also known as conditional expressions in Python, can be used to make our code shorter: But i d...
Collapse
 
billturner profile image
Bill Turner

That's interesting about the code coverage problem with the Python ternary. I'm just starting to learn Python myself, and I'll admit their ternary was disappointing to learn. It's the same as the CoffeeScript ternary, which I'm also not a fan of.

Neat and informative post!

Collapse
 
victorosilva profile image
Victor Silva

Thanks!