缺少智能感知,for循环中的自动补全

时间:2018-09-21 08:38:49

标签: python ide pycharm intellisense jetbrains-ide

我正在通过节点列表进行简单的for循环。

nodeList = obj.get_nodes_list()
for node in nodeList.items:
    print node.

节点是V1Node的类型,我想访问状态属性(字段)

这是我在PyCharm IDE的调试会话中得到的:

enter image description here

这就是我使用智能感知的方法:

enter image description here

问题:我在哪里拥有所有公共场所?!

1 个答案:

答案 0 :(得分:3)

在调试会话中,PyCharm可以访问对象的实例,并且可以检查并准确查看其具有的属性。当您编辑代码时,PyCharm不会运行任何东西,只能静态分析代码。它的功能受到Python缺乏类型声明的限制,因此,不显示所有可用成员是完全正常的。

要使PyCharm的智能感知更好地工作,您可以在代码中添加类型提示,如the documentation中所述。

相关问题