Assign type to a variable for IntelliSense without changing code

Is there a way in PyCharm to assign a type to a variable so that when I hit "." after that variable name all properties/methods for that variables are listed in drop-down.
For instance,

d = populate_dictionary()
for k, v in d.items():
  <CODE>

So in for loop, I need to call certain operation on k and/or v. IDE may not be able to figure out types of k and v, but I know what they could be, so I just assign types to them say str for k and dict for v. Is that possible without modifying code?

 

0

Please sign in to leave a comment.