def change_style(style, representer):
def new_representer(dumper, data):
scalar = representer(dumper, data)
scalar.style = style
return scalar
return new_representer
# represent_str does handle some corner cases, so use that
# instead of calling represent_scalar directly
评论列表
文章目录