def _is_numeric(obj):
    """Return True if obj is a number, otherwise False.

    >>> _is_numeric(2.5)
    True
    >>> _is_numeric('spam')
    False

    """
    try:
        obj + 0
    except TypeError:
        return False
    else:
        return True