1
0
forked from VimPlug/jedi

Generate type hints, fixes #987

This commit is contained in:
Dave Halter
2020-02-02 16:55:10 +01:00
parent f4b1fc479d
commit 4c7179bc87
8 changed files with 91 additions and 0 deletions

View File

@@ -513,6 +513,16 @@ class BaseDefinition(object):
def execute(self):
return _values_to_definitions(self._name.infer().execute_with_values())
def get_type_hint(self):
"""
Returns type hints like ``Iterable[int]`` or ``Union[int, str]``.
This method might be quite slow, especially for functions. The problem
is finding executions for those functions to return something like
``Callable[[int, str], str]``.
"""
return self._name.infer().get_type_hint()
class Completion(BaseDefinition):
"""