def _diff_fieldnames(fieldnames, fieldnames_key):
    """
    Returns the difference in the members of fieldnames and fieldnames_key.

    Checking membership is one-sided; There may be members of fieldnames_key
    that aren't members of fieldnames. This would be true if there are multiple
    delimited text files with different fieldnames that need to be merged. In
    that case, fieldnames_key would be the set of all fieldnames needed in the
    merged file, and fieldnames would only be made up of the fieldnames in a
    single delimited text file.
    """
    fieldnames = set(fieldnames)
    return fieldnames - fieldnames_key
