python-benedict/benedict/core/unique.py

13 lines
244 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
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)