python - What's the correct type hint for a type hint?
问题描述
I have a use case for accepting type hints as arguments to a function. But what is the right type hint to to accept a type hint?
T = TypeVar('T', bound='TypeHintType')
def register_handler(type_hint: T, handler: Handler[T]) -> None:
...
Is there a "TypeHintType" that I can use to annotate that a type hint is expected as an argument?
解决方案
推荐阅读
- amazon-web-services - 1 秒后 Lambda 超时
- javascript - chrome 扩展中的 FCM - getToken() 为空
- ajax - ckeditor 插入或更新在第一次尝试时不起作用
- javascript - 使用下拉菜单从 mysql 表中选择值时填写 html 表单
- android - 自动获取 otp kotlin 实现以进行短信阅读
- jquery - 为 jquery 中的多个第 n 个子项触发悬停状态的最有效方法
- gcc - 使用 gcc 4.8 的静态链接库 asan
- python - “长”对象没有属性“__getitem__”
- java - 如何在 Spring JPA 中更新 EmbeddedID 的字段
- typescript - 是否可以使用符号来利用类型安全?