Python 在_init__中的Pycharm类型暗示不起作用

Python 在_init__中的Pycharm类型暗示不起作用,python,python-2.7,pycharm,code-completion,type-hinting,Python,Python 2.7,Pycharm,Code Completion,Type Hinting,我正在使用Python 2.7和PyCharm社区版2016.3.2。我有以下代码片段: class ParentNode(node.Node): """ParentNode is a subclass of Node but also takes an additional child_nodes parameter. @type child_nodes: dict[str: child_node.ChildNode] """ def __init__(self

我正在使用Python 2.7和PyCharm社区版2016.3.2。我有以下代码片段:

class ParentNode(node.Node):
    """ParentNode is a subclass of Node but also takes an additional child_nodes parameter.
    @type child_nodes: dict[str: child_node.ChildNode]
    """
    def __init__(self, name, node_type, FSPs, CTT_distributions, TMR_distributions,
                 prob_on_convoy, rep_rndstrm, child_nodes):
        """ParentNode is a subclass of Node but also takes an additional child_nodes parameter.
        @type child_nodes: dict[str: child_node.ChildNode]
        """
        node.Node.__init__(self, name, node_type, FSPs, CTT_distributions, TMR_distributions,
                           prob_on_convoy, rep_rndstrm)
        self.network_status = 'parent'
        self.child_nodes = child_nodes
问题是,当我将鼠标悬停在
self.child\u节点
child\u节点
上时,推断的类型显示为
Any
,而不是
Dict[str,ChildNode]
。我不明白为什么文档字符串中的类型提示在这种情况下不起作用。

替换

dict[str:child\u node.ChildNode]

dict[str,child\u node.ChildNode]