pymongo_utils.py 文件源码

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

项目:zcp 作者: apolloliu 项目源码 文件源码
def unquote_keys(data):
    """Restores initial view of 'quoted' keys in dictionary data

    :param data: is a dictionary
    :return: data with restored keys if they were 'quoted'.
    """
    if isinstance(data, dict):
        for key, value in data.items():
            if isinstance(value, dict):
                unquote_keys(value)
            if key.startswith('%24'):
                k = parse.unquote(key)
                data[k] = data.pop(key)
    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号