查看源码区别:
#dumps源码
def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None,separators=None,default=None, sort_keys=False, **kw):
"""Serialize ``obj`` to a JSON formatted ``str``.
# 序列号 “obj” 数据类型 转换为 JSON格式的字符串"""
#dump源码
def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None,default=None, sort_keys=False, **kw):"""Serialize ``obj`` as a JSON formatted stream to ``fp`` (a``.write()``-supporting file-like object).
# 有两个动作,一个动作是将”obj“转换为JSON格式的字符串,还有一个动作是将字符串写入到文件中,也就是说文件描述符fp是必须要的参数"""
#loads源码
def loads(s, encoding=None,