C.cazabon@mindly.social
Nov 1, 2026, 7:56 PMBefore the ternary "operator" was available in Python expressions, I used to see this a fair bit:
item = (things or [None])[0]
I probably wouldn't use it today, though.
Before the ternary "operator" was available in Python expressions, I used to see this a fair bit:
item = (things or [None])[0]
I probably wouldn't use it today, though.
@cazabon I think I occasionally used this with a + instead of an or. But that required things to definitely be a list.