python-benedict/benedict/core/unique.py

10 lines
218 B
Python

def unique(d):
values = []
keys = list(d.keys())
for key in keys:
value = d.get(key, None)
if value in values:
d.pop(key, None)
continue
values.append(value)