mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix inference from type comment for function parameter with dot
fix for https://github.com/davidhalter/jedi/issues/1437
This commit is contained in:
committed by
Dave Halter
parent
00b220516d
commit
6d632a01eb
@@ -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 = []
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user