def object_name(x):
    """Get a human readable name for an object."""
    if hasattr(x, "__name__"):
        return x.__name__
    elif hasattr(x, "__func__"):
        return object_name(x.__func__)
    else:
        return str(x)