PyCharm自动完成,类型列表

fed*_*sov 11 python casting autocomplete heredoc pycharm

如何我可以告诉DocstringPyCharm返回类型列表中SomeClass的实例?

试过:@rtype [SomeClass]但它只是作为list.

fed*_*sov 13

def do_something():
    """
    @rtype: list of SomeClass
    """
    pass
Run Code Online (Sandbox Code Playgroud)

运行良好,将返回值解释为列表,并SomeClass在访问list元素时自动填充方法.