1
0
forked from VimPlug/jedi

Get iter() working and a lot of other typeshed reverse engineering of type vars

This commit is contained in:
Dave Halter
2018-09-16 02:19:29 +02:00
parent 6807e3b6d5
commit 5d9f29743c
5 changed files with 158 additions and 22 deletions

View File

@@ -25,11 +25,12 @@ class ExecutedParam(object):
self._lazy_context = lazy_context
self.string_name = param_node.name.value
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 pep0484_hints | doc_params
def infer(self, use_hints=True):
if use_hints:
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 pep0484_hints | doc_params
return self._lazy_context.infer()