Is there a way to help PyDev code completion by telling it the type of a variable?
With PDT, you can use PHPDoc-like syntax for such purpose:
/* @var $my_var MyClass */
$my_var = myFunction();
// PDT is able to figure out that $my_var is a MyClass object.
But till now, I cannot figure out how to do the same in python.
Nope (see the docs). It looks like PyDev does completion of imported stuff and language keywords.
It doesn’t seem like this would come up a lot though. The variable in question seems like it would only be unknown to pydev if it were passed in as a function argument with no default value.And, if you have a function operating on your own class, it seems like that should be a class member (so autocomplete would already work).