def is_integer(v):
    # type: (...) -> bool
    """Test whether a value is an integer (of any kind).

    Examples:
        >>> is_integer(1)
        True
        >>> is_integer(-0.123)
        False
        >>> is_integer(3.)
        False
        >>> is_integer(9223372036854775808)
        True
        >>> is_integer('1')
        False
        >>> is_integer(None)
        False
        >>> is_integer(numpy.int(3))
        True
    """
    try:
        from builtins import int
        return isinstance(v, int)  # Match both int and long on Py2
    except ImportError:
        from past.builtins import long
        return isinstance(v, (int, long))
Test whether a value is an integer (of any kind).

    Examples:
        >>> is_integer(1)
        True
        >>> is_integer(-0.123)
        False
        >>> is_integer(3.)
        False
        >>> is_integer(9223372036854775808)
        True
        >>> is_integer('1')
        False
        >>> is_integer(None)
        False
        >>> is_integer(numpy.int(3))
        True