Ejemplo n.º 1
0
    def infer(self):
        pep0484_hints = pep0484.infer_param(self._execution_context, self._param_node)
        doc_params = docstrings.infer_param(self._execution_context, self._param_node)
        if pep0484_hints or doc_params:
            return list(set(pep0484_hints) | set(doc_params))

        return self._lazy_context.infer()
Ejemplo n.º 2
0
    def infer(self, use_hints=True):
        if use_hints:
            doc_params = docstrings.infer_param(self._execution_context,
                                                self._param_node)
            ann = self.infer_annotations().execute_annotation()
            if ann or doc_params:
                return ann | doc_params

        return self._lazy_context.infer()