def ishashable(x):
    """Is x hashable?

    Examples
    --------
    >>> ishashable(1)
    True
    >>> ishashable([1])
    False

    """
    try:
        hash(x)
        return True
    except TypeError:
        return False
Is x hashable?

    Examples
    --------
    >>> ishashable(1)
    True
    >>> ishashable([1])
    False

    
src/flash/core/serve/dag/task.py