fix python binding warnings when testing if object is None