Is there a Python type for annotation that represents something that has `__contains__` method?

后端 未结 0 1275
迷失自我
迷失自我 2021-02-04 01:47

I look for Type such that the below type-checks OK:

import typing

def f(a: str, collection: Type):
    return a in collection

that

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