```python
def dict_depth(d):
    """
    Calculates the depth of a dictionary.

    The depth is defined as the maximum number of nested dictionaries.
    - An empty dictionary has a depth of 1.
    - A dictionary with no nested dictionaries has a depth of 1.
    - The depth of a non-dictionary value is 0.

    Args:
        d: The dictionary to measure.

    Returns:
        An integer representing the depth of the dictionary.
    """
    if not isinstance(d, dict):
        return 0

    if not d:
        return 1

    max_child_depth = 0
    for value in d.values():
        child_depth = dict_depth(value)
        if child_depth > max_child_depth:
            max_child_depth = child_depth

    return 1 + max_child_depth

```