3 ms·
I don't think it's backwards, it's just different than C and derivatives, and makes different things simple. I quite like the x = ( 1/y if y > 0 else
by karatinversion 5y ago
I don't think it's backwards, it's just different than C and derivatives, and makes different things simple. I quite like the
x = ( 1/y if y > 0 else
-1/y if y < 0 else
nan())
idiom.
- NwtnsMthd 5y agoThank you! For years I've tried to figure out how to chain the Python ternary operator while maintaining readability, and here it is!