My function definition contains both named and unnamed kwargs:
def safe_format(text: str, max_errors: int = 10, **kwargs: str) -> None:
print(text)
print(max_errors)
print(kwargs)
If I call it without specifying max_errors:
safe_format(some_str, **some_dict)
I do get the expected result (some_str is printed, then 10, then some_dict). Yet mypy is unhappy and believes I'm trying to use some_dict as a value for max_errors:
Argument 2 to "safe_format" has incompatible type "**Dict[str, str]"; expected "int"
Is there a specific syntax I can use for mypy to recognize what I'm doing?