Fix inference from type comment for function parameter with dot

fix for https://github.com/davidhalter/jedi/issues/1437
This commit is contained in:
Jérome Perrin
2019-11-08 11:07:31 +01:00
committed by Dave Halter
parent 00b220516d
commit 6d632a01eb
2 changed files with 15 additions and 1 deletions

View File

@@ -91,7 +91,7 @@ def _split_comment_param_declaration(decl_text):
debug.warning('Comment annotation is not valid Python: %s' % decl_text)
return []
if node.type == 'name':
if node.type in ['name', 'atom_expr', 'power']:
return [node.get_code().strip()]
params = []

View File

@@ -38,6 +38,20 @@ def test(a, b):
#? str()
e
class AA:
class BB:
pass
def test(a):
# type: (AA.BB) -> None
#? AA.BB()
a
def test(a):
# type: (AA.BB,) -> None
#? AA.BB()
a
a,b = 1, 2 # type: str, float
#? str()
a