问题
I'm doing simple for loop through my node lists.
nodeList = obj.get_nodes_list()
for node in nodeList.items:
print node.
Node is type of V1Node and I want to access status property (field)
This is what I get in PyCharm IDE in debugging session:
And this is what I have using intellisense:
Question: Where I have all the public fields ?!
回答1:
In a debug session, PyCharm has access to the instance of an object, and can inspect and see exactly which attributes it has. When you're editing the code, PyCharm does not run anything, and can only analyze the code statically. Its capabilities to do so are limited by Python's lack of type declarations, so it's perfectly normal that it does not display all available members.
To make PyCharm's intellisense work better, you can add type hints to your code, as described in the documentation.
来源:https://stackoverflow.com/questions/52439803/missing-intellisense-autocompletion-in-for-loop