def METHOD_NAME(self, x, strict=False, allow_downcast=None):
    # Dummy filter: we want this type to represent strings that
    # start with `self.thingy`.
    if not isinstance(x, str):
        raise TypeError("Invalid type")
    if not x.startswith(self.thingy):
        raise ValueError("Invalid value")
    return x