File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/dictdiffer.cpython-310.pyc
o
�N�g�A � @ sV d Z ddlZddlmZ dd� ZG dd� d�Zddd �Zddd�ZG d
d� de�ZdS )a�
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
Originally posted at http://stackoverflow.com/questions/1165352/fast-comparison-between-two-python-dictionary/1165552#1165552
Available at repository: https://github.com/hughdbrown/dictdiffer
Added the ability to recursively compare dictionaries
� N)�Mappingc C s
t | |�S �N)�
DictDiffer)�current_dict� past_dict� r �I/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/dictdiffer.py�diff s
r c @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
r z�
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
c C s@ ||| _ | _tt|��tt|��| _| _| j�| j�| _d S r )r r �set�list�set_current�set_past�intersection� intersect)�selfr r r r r �__init__ s zDictDiffer.__init__c C � | j | j S r )r r �r r r r �added$ � zDictDiffer.addedc C r r )r
r r r r r �removed'