Python type hinting for a Callable that supports subclasses

前端 未结 0 1225
孤独总比滥情好
孤独总比滥情好 2021-01-28 04:33

I would like to type-hint a method that may receive a Callable that operates on A or sub-classes of A:

def do(f: Callable[[A], None])

I\'ve also

相关标签:
回答
  • 消灭零回复
提交回复
热议问题