from typing import Any


def gen_python_hash(obj: Any) -> int:
    """Generate Python hash for given object, if hashable.
    NOTE: Python hash output is an int and does not have the same
    uniqueness guarantees as a cryptographic hash function.  Use
    with caution.
    """
    if hasattr(obj, "__hash__") and callable(obj.__hash__):
        return hash(obj)
    if isinstance(obj, (list, tuple)):
        return hash(tuple(gen_python_hash(item) for item in obj))
    if isinstance(obj, dict):
        return hash(tuple((gen_python_hash(key), gen_python_hash(value)) for key, value in obj.items()))
    raise TypeError("cannot generate hash for type {}".format(type(obj).__name__))