Python UserDict.DictMixin 模块,iteritems() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用UserDict.DictMixin.iteritems()

项目:deb-python-cassandra-driver    作者:openstack    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))

        self._items = []
        self._index = {}
        if args:
            e = args[0]
            if callable(getattr(e, 'keys', None)):
                for k in e.keys():
                    self._insert(k, e[k])
            else:
                for k, v in e:
                    self._insert(k, v)

        for k, v in six.iteritems(kwargs):
            self._insert(k, v)
项目:python-dse-driver    作者:datastax    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))

        self._items = []
        self._index = {}
        if args:
            e = args[0]
            if callable(getattr(e, 'keys', None)):
                for k in e.keys():
                    self._insert(k, e[k])
            else:
                for k, v in e:
                    self._insert(k, v)

        for k, v in six.iteritems(kwargs):
            self._insert(k, v)
项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def __iter__(self):
            return self._dictionary.iteritems()
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def iteritems(self, raw=False):
        """ Iterate self items. """

        for key in self:
            yield key, self.__getitem__(key, raw=raw)