PythonUtil.py 文件源码

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

项目:POTCO-PS 作者: ksmit799 项目源码 文件源码
def __init__(self, items, start=0):
        if type(items) == types.StringType:
            items = items.split(',')

        self._stringTable = {}

        # make sure we don't overwrite an existing element of the class
        assert self._checkExistingMembers(items)
        assert uniqueElements(items)

        i = start
        for item in items:
            # remove leading/trailing whitespace
            item = string.strip(item)
            # is there anything left?
            if len(item) == 0:
                continue
            # make sure there are no invalid characters
            assert Enum._checkValidIdentifier(item)
            self.__dict__[item] = i
            self._stringTable[i] = item
            i += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号