Re:The PEPs of Python 3.9
by dragonwriter on Thursday May 28, 2020 @11:15PM
(#23345926)
Ternaries don't discard results that are generated, they are just special short-circuiting operators;
Is effectively syntax sugar for:
Nothing is discarded after evaluation, one of three arms is never evaluated, just as one of two arms of a common short-circuiting Boolean operator often (but not always) is not. That's essentially the opposite of executing and producing possible side effects and then discarding the results.
[ Parent
| on HN ]
There are no comments on this comment yet.