r"""
    add / concatenate / union / join / merge / combine dictionaries

    Copies the first dictionary given and then repeatedly calls update using
    the rest of the dicts given in args. Duplicate keys will receive the last
    value specified the list of dictionaries.

    Returns:
        dict: mergedict_

    CommandLine:
        python -m utool.util_dict --test-merge_dicts

    References:
        http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_dict import *  # NOQA
        >>> import utool as ut
        >>> x = {'a': 1, 'b': 2}
        >>> y = {'b': 3, 'c': 4}
        >>> mergedict_ = merge_dicts(x, y)
        >>> result = ut.repr4(mergedict_, sorted_=True, newlines=False)
        >>> print(result)
        {'a': 1, 'b': 3, 'c': 4}

def merge_dicts(*args):
    r"""
    add / concatenate / union / join / merge / combine dictionaries

    Copies the first dictionary given and then repeatedly calls update using
    the rest of the dicts given in args. Duplicate keys will receive the last
    value specified the list of dictionaries.

    Returns:
        dict: mergedict_

    CommandLine:
        python -m utool.util_dict --test-merge_dicts

    References:
        http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_dict import *  # NOQA
        >>> import utool as ut
        >>> x = {'a': 1, 'b': 2}
        >>> y = {'b': 3, 'c': 4}
        >>> mergedict_ = merge_dicts(x, y)
        >>> result = ut.repr4(mergedict_, sorted_=True, newlines=False)
        >>> print(result)
        {'a': 1, 'b': 3, 'c': 4}

    """
    iter_ = iter(args)
    mergedict_ = six.next(iter_).copy()
    for dict_ in iter_:
        mergedict_.update(dict_)
    return mergedict_