尝试学习 Python 3.10 模式匹配。在阅读8.6.4.9 后尝试了这个例子。映射模式
>>> match 0.0:
... case int(0|1):
... print(1)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: called match pattern must be a type
>>>
特别是关于内置类型的注释,包括 int。我应该如何编写代码来测试整数值 0 或 1(文档中的示例)而不出现此错误?