The code was: if x == None and y == None: return True And should be: if x is None and y is None: return True