It’s a pity Python doesn’t provide a None -coalescing operator . The ternary alternative is way more verbose and the or solution is simply not the same (as it handles all “falsy” values, not just None – that’s not always what you’d want and can be more error-prone).9 Kas 2011
Read moreIS null operator in Python?
There’s no null in Python . Instead, there’s None. As stated already, the most accurate way to test that something has been given None as a value is to use the is identity operator, which tests that two variables refer to the same object.
Read more