def _post_resolution_check(
    arr_x: ndarray,
    arr_y: ndarray,
    obj_x: Any,
    obj_y: Any,
    op_code: BinaryOpCode,
) -> tuple[ndarray, ndarray, BinaryOpCode]:
    """When we were passed Python integers, they may not fit into the operation
    dtype.  In that case, however, we can just define the result.
    Note that as of now, we don't try to do this if both operands were Python
    ints.
    """
    truthiness = None  # cannot guess the truthiness based on the scalar value

    if type(obj_x) is int and type(obj_y) is int:
        # No special behavior currently, check if values fit operation
        if arr_x.dtype.kind in "iu":
            # Check if original Python integer fits first operand.
            arr_x.dtype.type(obj_x)
        if arr_y.dtype.kind in "iu":
            # Check if original Python integer fits second operand.
            arr_y.dtype.type(obj_y)

    elif type(obj_x) is int and arr_x.dtype.kind in "iu":
        iinfo = np.iinfo(arr_x.dtype)
        if obj_x < iinfo.min:
            truthiness = op_code in {
                BinaryOpCode.NOT_EQUAL,
                BinaryOpCode.LESS,
                BinaryOpCode.LESS_EQUAL,
            }
        elif obj_x > iinfo.max:
            truthiness = op_code in {
                BinaryOpCode.NOT_EQUAL,
                BinaryOpCode.GREATER,
                BinaryOpCode.GREATER_EQUAL,
            }

        if truthiness is not None:
            # Replace with an always-true/always-false operation
            arr_x = convert_to_cupynumeric_ndarray(
                np.array(iinfo.min, dtype=arr_x.dtype)
            )
            op_code = (
                BinaryOpCode.GREATER_EQUAL if truthiness else BinaryOpCode.LESS
            )

    elif type(obj_y) is int and arr_y.dtype.kind in "iu":
        iinfo = np.iinfo(arr_y.dtype)
        if iinfo.min > obj_y:
            truthiness = op_code in {
                BinaryOpCode.NOT_EQUAL,
                BinaryOpCode.GREATER,
                BinaryOpCode.GREATER_EQUAL,
            }
        elif iinfo.max < obj_y:
            truthiness = op_code in {
                BinaryOpCode.NOT_EQUAL,
                BinaryOpCode.LESS,
                BinaryOpCode.LESS_EQUAL,
            }

        if truthiness is not None:
            # Replace with an always-true/always-false operation
            arr_y = convert_to_cupynumeric_ndarray(
                np.array(iinfo.min, dtype=arr_y.dtype)
            )
            op_code = (
                BinaryOpCode.GREATER_EQUAL if truthiness else BinaryOpCode.LESS
            )

    return arr_x, arr_y, op_code
When we were passed Python integers, they may not fit into the operation
    dtype.  In that case, however, we can just define the result.
    Note that as of now, we don't try to do this if both operands were Python
    ints.
    
cupynumeric/_ufunc/comparison.py