from typing import MutableMapping


def get_dict_diff(a, b):
    """
    Get the differences between a, and b
    Supports nested dictionaries as well.

    >>> a = dict(
    ...     myBool = True,
    ...     myDict = {1:'a', 2:'b'},
    ... )
    >>> b = dict(
    ...     myBool = False,
    ...     myDict = {3:'c'},
    ...     myString = 'hi'
    ... )
    >>> get_dict_diff(b, a)
    {'myString': 'hi', 'myDict': {3: 'c'}, 'myBool': False}
    >>> a['myBool'] = False
    >>> get_dict_diff(b, a)
    {'myString': 'hi', 'myDict': {3: 'c'}}
    """
    diff = {}
    for k, a_value in a.items():
        if k in b.keys():
            b_value = b[k]
            if a_value == b_value:
                continue
            else:
                # Check for a nested dict
                # If so, compare values inside it
                if isinstance(a_value, MutableMapping):
                    # set any nested differences
                    nested_diff = get_dict_diff(a_value, b_value)
                    if not nested_diff:
                        continue
                    diff[k] = nested_diff

        # If it hasn't been added to the diff as a nested diff
        # add it now
        if k not in diff:
            diff[k] = a_value

    return diff