make_stub_files.py 文件源码

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

项目:dotfiles 作者: zchee 项目源码 文件源码
def reduce_numbers(self, aList):
        '''
        Return aList with all number types in aList replaced by the most
        general numeric type in aList.
        '''
        trace = False
        found = None
        numbers = ('number', 'complex', 'float', 'long', 'int')
        for kind in numbers:
            for z in aList:
                if z == kind:
                    found = kind
                    break
            if found:
                break
        if found:
            assert found in numbers, found
            aList = [z for z in aList if z not in numbers]
            aList.append(found)
        if trace: g.trace(aList)
        return aList
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号