Type annotations for *args and **kwargs have been improperly used, leading to failures in type checks. When defining function arguments with *args, the types need to align with the values contained. Specifically, one must define the argument types directly, rather than attempting to annotate the container's type. For example, adjust from defining types as tuples or dicts to simply the actual value types of the parameters, which allows the code to pass type checks successfully.
A reduction in boilerplate confused me, the answer is that the type to define is the value in the containers.
That's because the types you set apparently the value of the container. So to make my code pass the type checkers I need to do: def func(*args: str, **kwargs: Any): pass.
Collection
[
|
...
]