doc.py 文件源码

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

项目:metatab 作者: Metatab 项目源码 文件源码
def sort_sections(self, order):
        """
        Sort sections according to the section names in the order list. All remaining sections
         are added to the end in their original order

        :param order: Iterable of section names
        :return:
        """

        order_lc = [e.lower() for e in order]

        sections = OrderedDict( (k,self.sections[k]) for k in order_lc if k in self.sections)

        sections.update( (k,self.sections[k]) for k in self.sections.keys() if k not in order_lc)

        assert len(self.sections) == len(sections)

        self.sections = sections
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号