Suppose I have such function:
def render(someobject):
someobject. #here i expect IDE to know which class it is and autocompletion and other IDE functional will be available
dorender()
In my case the IDE has no way to know what goes in there. How I tell it by using comments?
In case of PHP i've used something like this
/**
* @param MyClass myobject
**/
function render($myobject){
//by typing $myobject-> IDE already knows, that it should use $myobject as MyClass objec
dorender()
}
Another use case is when I know, that in some case some proxy will return some object IDE has no chance to know, but I know for sure and want to specify this by comment, to help myself in future and to help IDE.
In PHP while using PhpStorm I would do following:
$myobject=some_proxy()
/**
* @var $my_object MyClass
**/
// in following code IDE will use $myobject as MyClass
How can I achieve same behavior with PyCharm specificaly and python documentators in common?