The result is meaningless (and it emits a warning in cpython2 when called with -3), so handle None before making integer comparisons.