def is_dict_like(obj):
    """Check if `obj` behaves like a dictionary."""
    return all(
        hasattr(obj, attr) for attr in ("__getitem__", "keys", "__contains__")
    ) and not isinstance(obj, type)