if not isinstance(key, self.key_type):
            raise KeyError("Expected type {}, got {}".format(self.key_type, type(key)))