What is the pythonic way to write a ternary operator like this in the shortest possible way?
(x!=null)? x.something:0;
I want to use something like
y = x.something or 0
but that will check references in a way such that
x.y.z = None whenever x or y are None