标签: python generics visual-studio-code
我期望自动完成功能告诉我obj是Model类型(来自基类),但是它说ApiController。我在这里做错什么了吗?
Model
ApiController
答案 0 :(得分:0)
您已将TypeVar指定为'Model'。您应该改用def save(self, obj: str)作为函数定义。
TypeVar
'Model'
def save(self, obj: str)