def __init__(self, kt=None, vt=None, data=None):
        """This is a typed dict implementation that optionally enforces given
        types on contained values on assignment."""

        self._kt = kt
        self._vt = vt

        if kt is None and vt is None:
            self.check = self._check_noop
        elif kt is None:
            self.check = self._check_v
        elif vt is None:
            self.check = self._check_k
        else:
            self.check = self._check_kv

        if data is not None:
            self.update(data)