用户创建的类应该如何在 Python 3.5 的类型提示中表示?
from typing import List
from debt import Debt
class Debts:
def __init__(self, debts: List[Debt]): # Expected Integral type
self.overall = debts
我知道打字。TypeVar,但 PyCharm 也给了我同样的错误。我错过了什么?
用户创建的类应该如何在 Python 3.5 的类型提示中表示?
from typing import List
from debt import Debt
class Debts:
def __init__(self, debts: List[Debt]): # Expected Integral type
self.overall = debts
我知道打字。TypeVar,但 PyCharm 也给了我同样的错误。我错过了什么?