INNER CODE UNIT · Python

diff_dict

fa0311/TwitterInternalAPIDocument · lib/diff.py:21

def diff_dict(new_data, old_data):
    output = {
        "add": [],
        "remove": [],
    }
    for new in new_data.keys():
        for old in old_data.keys():
            if new == old:
                break
        else:
            output["add"].append(new)
    for old in old_data.keys():
        for new in new_data.keys():
            if new == old:
                break
        else:
            output["remove"].append(old)
    return output

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…