支持类型提示 PyCharm
Support for Type Hints PyCharm
我正在尝试使用类型提示编写代码。不过,我的IDE PyCharm 2021.1(社区版)好像帮不了我。我错过了什么吗?
您可以这样输入提示,Pycharm 会用 Expected type 'int' (matched generic type '_T'), got 'str' instead
突出显示 "foo"
my_list: list[int] = []
my_list.append(4)
my_list.append("foo")
我正在尝试使用类型提示编写代码。不过,我的IDE PyCharm 2021.1(社区版)好像帮不了我。我错过了什么吗?
您可以这样输入提示,Pycharm 会用 Expected type 'int' (matched generic type '_T'), got 'str' instead
"foo"
my_list: list[int] = []
my_list.append(4)
my_list.append("foo")