ast.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:monasca-analytics 作者: openstack 项目源码 文件源码
def _build_connection_cache(self):
        """
        Build a cache of connections keyed by where they start from.
        """
        for ident_from, ident_to in self.connections:
            if ident_from.val not in self.connections_cache:
                self.connections_cache[ident_from.val] = []
            if ident_to.val not in self.connections_cache:
                self.connections_cache[ident_to.val] = []
            self.connections_cache[ident_from.val].append(ident_to.val)
        # Sanity check
        for _, vals in self.connections_cache:
            if len(set(vals)) != len(vals):
                raise p.ParseFatalException("Bug found in Connection!!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号