1
0
forked from VimPlug/jedi

Return annotations for compiled objects now help to infer

However only if it's a type, if it's a string, it doesn't work, yet

Fixes #1347
This commit is contained in:
Dave Halter
2019-06-22 00:15:20 +02:00
parent a62ba86d7b
commit aa2dc6be09
3 changed files with 20 additions and 1 deletions

View File

@@ -46,6 +46,11 @@ class CompiledObject(Context):
self.access_handle = access_handle
def py__call__(self, arguments):
return_annotation = self.access_handle.get_return_annotation()
if return_annotation is not None:
# TODO the return annotation may also be a string.
return create_from_access_path(self.evaluator, return_annotation).execute_annotation()
try:
self.access_handle.getattr_paths(u'__call__')
except AttributeError: