4 ms·
what do you think about if-expressions? x if cond else y IMO match-expressions have basically the same benefits/trade-offs.
by uryga 6y ago
what do you think about if-expressions?
x if cond else y
IMO match-expressions have basically the same benefits/trade-offs.
- BiteCode_dev 6y agoMatch are usually much more complex than a single ternary condition. Allow to inline them and you will see monsters in the wild. But I do wish they would have not set aside generalized unpacking.
- uryga 6y ago> Allow to inline them and you will see monsters in the wild. idk... you can write a huge ugly if-elif-else like this: a if foo else b if bar else c if quux else d but most people just don't.
- deleted 6y ago[deleted]
- heavenlyblue 6y agoTernary expressions are not covered by python code coverage tools by the way.