预期的积分类型:Python 3.5 类型提示和 Pycharm
Integral Type expected: Python 3.5 type hinting and 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
我知道 typing.TypeVar,但是 PyCharm 也给我同样的错误。我错过了什么?
PyCharm 5 显然已经完全支持 Python 3.5 的类型提示。
如何创建用户 类 应该在 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
我知道 typing.TypeVar,但是 PyCharm 也给我同样的错误。我错过了什么?
PyCharm 5 显然已经完全支持 Python 3.5 的类型提示。