#5002·pyrefly

特性: `assert_type_unspellable_subtype`

作者: rchen152创建于 2026年9月22日更新于 2026年9月22日
标签typechecking

描述错误 ty 有一个名为 assert_type_unspellable_subtype 的错误类型,当 (1) assert_type 失败,且 (2) 实际类型可赋值给预期类型,且 (3) 实际类型无法使用类型注解表示时,就会触发此错误。这对于 pyrefly 也很有用,这样对于"不可拼写"的类型(如重载),您可以编写一个 assert_type 并抑制 assert_type_unspellable_subtype 错误,而不必意外抑制更广泛的 assert_type 错误。

内容来源: facebook/pyrefly