1
0
forked from VimPlug/jedi

Make sure that CompiledValue can deal with string annotations

Fixes #952
Inspired by #1461
This commit is contained in:
Dave Halter
2020-01-10 12:39:40 +01:00
parent 072d506302
commit ba7776c0d9
2 changed files with 50 additions and 0 deletions

View File

@@ -538,6 +538,17 @@ class DirectObjectAccess(object):
if o is None:
return None
try:
# Python 2 doesn't have typing.
import typing
except ImportError:
pass
else:
try:
o = typing.get_type_hints(self._obj).get('return')
except Exception:
pass
return self._create_access_path(o)
def negate(self):