我们广泛使用TypedDicts,以确保我们生成的数据能够以正确的数据类型传递到TypeScript前端。MyPy/PyCharm/等在检查我们的新代码是否输出符合的数据方面做得很好,但我们想要测试许多RestSerializer/ModelSerializers的输出是否符合TypeDict。但如果将PersonData定义为: class PersonData(TypedDict): affiliations: Union[List我想知道的是,是否
example有一个方法change,它从example2调用change_var并传递self作为参数。在从change_var内部调用change时,MYPY会给出错误Argument 1 to "change_var" has incompatible type "__main__.TestClass对于为什么这不起作用,我的直觉是,TestClass在调用change_var时没有被完全定义?出于