Python通用继承和vscode智能感知(MSLS)

时间:2019-12-18 13:09:52

标签: python generics visual-studio-code

我期望自动完成功能告诉我obj是Model类型(来自基类),但是它说ApiController。我在这里做错什么了吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

您已将TypeVar指定为'Model'。您应该改用def save(self, obj: str)作为函数定义。