decoders.py 文件源码

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

项目:central 作者: viniciuschiele 项目源码 文件源码
def _to_dict(self, o):
        """
        Convert a given object to dict.
        :param o: The object to be converted.
        :return dict: The dict value converted.
        """
        if isinstance(o, MutableMapping):
            return o

        if not isinstance(o, string_types):
            raise TypeError('Expected str, got %s' % text_type(type(o)))

        pairs = o.split(self.dict_delimiter)

        d = IgnoreCaseDict()

        for pair in pairs:
            kv = pair.split('=')

            key = kv[0].strip()
            value = kv[1].strip()

            d[key] = value

        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号