Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fmt_dict(k, v):
if isinstance(v, dict):
return k, Hashabledict(v)
if isinstance(v, list):
return k, ",".join(map(str, v))
return k, v
def _diff(self):
def fmt_dict(k, v):
if isinstance(v, dict):
return k, Hashabledict(v)
if isinstance(v, list):
return k, ",".join(map(str, v))
return k, v
current = Hashabledict(
{fmt_dict(k, v) for k, v in self.serialize().items()}
)
init = Hashabledict(
{fmt_dict(k, v) for k, v in self.serialize(init=True).items()}
)
return set([i[0] for i in set(current.items()) ^ set(init.items())])
def _diff(self):
def fmt_dict(k, v):
if isinstance(v, dict):
return k, Hashabledict(v)
if isinstance(v, list):
return k, ",".join(map(str, v))
return k, v
current = Hashabledict(
{fmt_dict(k, v) for k, v in self.serialize().items()}
)
init = Hashabledict(
{fmt_dict(k, v) for k, v in self.serialize(init=True).items()}
)
return set([i[0] for i in set(current.items()) ^ set(init.items())])