mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Deal with annotation on *args and **kwargs correctly, fixes #980
This commit is contained in:
@@ -165,3 +165,19 @@ def keyword_only(a: str, *, b: str):
|
||||
a.startswi
|
||||
#? ['startswith']
|
||||
b.startswi
|
||||
|
||||
|
||||
def argskwargs(*args: int, **kwargs: float):
|
||||
"""
|
||||
This might be a bit confusing, but is part of the standard.
|
||||
args is changed to Tuple[int] in this case and kwargs to Dict[str, float],
|
||||
which makes sense if you think about it a bit.
|
||||
"""
|
||||
#? tuple()
|
||||
args
|
||||
#? int()
|
||||
args[0]
|
||||
#? str()
|
||||
next(iter(kwargs.keys()))
|
||||
#? float()
|
||||
kwargs['']
|
||||
|
||||
Reference in New Issue
Block a user