def _set_type(self, other_type=ANY_TYPE, signature=None):
        assert isinstance(other_type, Type)

        if signature is None:
            signature = defaultdict(list)

        self.argument._set_type(ANY_TYPE, signature)
        try:
            self.function._set_type(ComplexType(self.argument.type, other_type), signature)
        except TypeResolutionException:
            raise TypeException(
                    "The function '%s' is of type '%s' and cannot be applied "
                    "to '%s' of type '%s'.  Its argument must match type '%s'."
                    % (self.function, self.function.type, self.argument,
                       self.argument.type, self.function.type.first))
:see Expression._set_type()
dataset/ETHPy150Open nltk/nltk/nltk/sem/logic.py/ApplicationExpression._set_type