4 ms·
It's sad that such a common and concise idiom as "x or y" is so perniciously, subtly broken in Python, and that there is no satisfyingly concise equivalent. If
by dilap 16y ago
It's sad that such a common and concise idiom as "x or y" is so perniciously, subtly broken in Python, and that there is no satisfyingly concise equivalent.
If I were being cavalier and had an extra wish to burn, I'd request
x else y
to mean x unless x is None.