![](/img/trans.png)
[英]How do I define a Python Protocol for a type that is Callable with any number of keyword arguments of Any type?
[英]How do I define a “Callable” type that corresponds to a function with variable arguments?
我喜歡確保我有准確的類型提示,但是如何使用typing.Callable
編寫此函數的類型?
def f(x: int, *args, **kwargs):
pass
例如
Callable[[int, ?????], None]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.