Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我mypy在我的项目中使用,我的方法 self 对象应该被赋予什么类型?
mypy
from typing import List class Example: def __init__(self, arg1: List[str]) -> None: pass
没什么,就这样吧。
这就是我从他们的文档中可以看出的: https ://mypy.readthedocs.io/en/latest/class_basics.html?highlight=self