4 ms·
It's worth noting that Peter himself mentions that most of the ternary tricks he describes are not very readable and wouldn't be considered Pythonic. Beauti
by adambyrtek 16y ago
It's worth noting that Peter himself mentions that most of the ternary tricks he describes are not very readable and wouldn't be considered Pythonic.
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Personally I'd hate to see something like that in any real-world project.
(test and [result] or [alternative])[0]
- cema 16y agoDepending on the language, it could be an idiom.