I the below function foo
, which has:
- One positional arg with a known type
- A variable number of positional and keyword args after that
from typing import Callable def foo(bar: str, *args, **kwargs) -> None: """Some function with one positional arg and then *args and **kwargs.""" foo_: Callable[[str, ...], None] = foo # error: Unexpected '...'
How can I type hint this?
Currently, mypy==0.812
throws the error: error: Unexpected '...' [misc]
没有评论:
发表评论