comparisons to `None` should be `is None` or `is not None`, you should not use `==` nor `!=` for those.