mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-28 14:54:36 +07:00
Type of vararg parameter should be seen differently inside method body and at the call site. For instance, in case of positional vararg, it should be represented as "Iterable[T]" in function quick doc, but as "Tuple[T, ...]" inside its body, because without the latter type checker might complain about missing tuple's methods called on such parameter. Unfortunately, we're not able to represent homogeneous tuples of arbitrary length in our type system so far, so it's just raw tuple for now. The same thing applies to keyword varargs, since collections.Mapping doesn't contain all methods defined for built-in dict. At least we can parametrize type of the standard dict properly with the types of its keys and values.
5 lines
102 B
Python
5 lines
102 B
Python
def f(*args, **kwargs):
|
|
# type: (*str, **str) -> None
|
|
args.index('foo')
|
|
kwargs.pop('bar')
|