voipms-python/voipms/base/values.py

12 lines
237 B
Python
Raw Normal View History

2019-08-18 02:02:44 +00:00
unset = object()
def of(d):
"""
Remove unset values from a dict.
:param dict d: A dict to strip.
:return dict: A dict with unset values removed.
"""
2020-03-17 02:58:09 +00:00
return {k: v for k, v in d.items() if v != unset}