1
0
forked from VimPlug/jedi

Avoid function executions if they are not necessary

This also means that annotations are prefered to docstring types
This commit is contained in:
Dave Halter
2019-08-24 11:59:13 +02:00
parent e0f26dd7a1
commit 88cf198552
5 changed files with 15 additions and 11 deletions

View File

@@ -33,9 +33,8 @@ class ExecutedParam(object):
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
if doc_params:
return doc_params
return self._lazy_value.infer()