File: values.py

package info (click to toggle)
python-twilio 9.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,756 kB
  • sloc: python: 8,281; makefile: 65
file content (13 lines) | stat: -rw-r--r-- 280 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
from typing import Dict

unset = object()


def of(d: Dict[str, object]) -> Dict[str, object]:
    """
    Remove unset values from a dict.

    :param d: A dict to strip.
    :return A dict with unset values removed.
    """
    return {k: v for k, v in d.items() if v != unset}