How to tell pycharm the type of a index variable when looping
已回答
Let's say I am looping through a list of objects:
for object in objects:
# do something
Is there some way I can inform pycharm as to the type of object so that I get the method auto-completion pops up?
请先登录再写评论。
You can use one of the flavors of Python type hinting. What version of Python are you using?
Type hinting in 2.x example I used recently.