cim_obj.py 文件源码

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

项目:docker-zenoss4 作者: krull 项目源码 文件源码
def __init__(self, *args, **kwargs):

        self.data = {}

        # Initialise from sequence object

        if len(args) == 1 and type(args[0]) == list:
            for item in args[0]:
                self[item[0]] = item[1]

        # Initialise from mapping object

        if len(args) == 1 and type(args[0]) == dict:
            self.update(args[0])

        # Initialise from NocaseDict

        if len(args) == 1 and isinstance(args[0], NocaseDict):
            self.data = args[0].data.copy()

        # Initialise from keyword args

        self.update(kwargs)

    # Basic accessor and settor methods
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号