加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python-3.x – 期望的Integral Type:Python 3.5类型提示和Pycha

发布时间:2020-12-20 13:51:30 所属栏目:Python 来源:网络整理
导读:如何在 Python 3.5的类型提示中表示用户创建的类? from typing import Listfrom debt import Debtclass 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也给了我同样的错误.我错过了什么?

解决方法

PyCharm 5显然已经完全支持Python 3.5的类型提示.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读