def is_integer(x):
    """
    Is `x` an integer?
    
    Does return `True` for things like 1.0 and `1+0j`.
    """
    try:
        inted_x = int(x)
    except (TypeError, ValueError, OverflowError):
        return False
    return inted_x == x
