mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Use infer_annotation only from param name
This commit is contained in:
@@ -21,14 +21,12 @@ class ExecutedParam(object):
|
|||||||
def __init__(self, execution_context, param_node, lazy_value, is_default=False):
|
def __init__(self, execution_context, param_node, lazy_value, is_default=False):
|
||||||
self._execution_context = execution_context
|
self._execution_context = execution_context
|
||||||
self._param_node = param_node
|
self._param_node = param_node
|
||||||
|
from jedi.inference.names import ParamName
|
||||||
|
self._name = ParamName(execution_context, param_node.name)
|
||||||
self._lazy_value = lazy_value
|
self._lazy_value = lazy_value
|
||||||
self.string_name = param_node.name.value
|
self.string_name = param_node.name.value
|
||||||
self._is_default = is_default
|
self._is_default = is_default
|
||||||
|
|
||||||
def infer_annotations(self):
|
|
||||||
from jedi.inference.gradual.annotation import infer_param
|
|
||||||
return infer_param(self._execution_context, self._param_node)
|
|
||||||
|
|
||||||
def infer(self, use_hints=True):
|
def infer(self, use_hints=True):
|
||||||
return self._lazy_value.infer()
|
return self._lazy_value.infer()
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ class ExecutedParam(object):
|
|||||||
argument_values = self.infer(use_hints=False).py__class__()
|
argument_values = self.infer(use_hints=False).py__class__()
|
||||||
if self._param_node.star_count:
|
if self._param_node.star_count:
|
||||||
return True
|
return True
|
||||||
annotations = self.infer_annotations()
|
annotations = self._name.infer_annotation(execute_annotation=False)
|
||||||
if not annotations:
|
if not annotations:
|
||||||
# If we cannot infer annotations - or there aren't any - pretend
|
# If we cannot infer annotations - or there aren't any - pretend
|
||||||
# that the signature matches.
|
# that the signature matches.
|
||||||
|
|||||||
Reference in New Issue
Block a user