I'm doing a bunch of operations that are basically:
if ((x is not None) and (y is not None)) and x > y: do_something I'm doing this operation on every row of a data table where some of the values are null. Is there a more pythonic way of going about this, without have to check for None each time?
xandyare going to use large expression you could split this condition into different if-conditions firstly checking forNoneand then comparingxandyif not None in (x, y) and x > y:. This form can easily be extended to even more variables.