mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +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)
|
debug.warning('Comment annotation is not valid Python: %s' % decl_text)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if node.type == 'name':
|
if node.type in ['name', 'atom_expr', 'power']:
|
||||||
return [node.get_code().strip()]
|
return [node.get_code().strip()]
|
||||||
|
|
||||||
params = []
|
params = []
|
||||||
|
|||||||
@@ -38,6 +38,20 @@ def test(a, b):
|
|||||||
#? str()
|
#? str()
|
||||||
e
|
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
|
a,b = 1, 2 # type: str, float
|
||||||
#? str()
|
#? str()
|
||||||
a
|
a
|
||||||
|
|||||||
Reference in New Issue
Block a user