替换处理十进制编码的 django.utils.simplejson?

Drop in replacement for django.utils.simplejson that handles Decimal encoding?

随着 1.7 中 django.utils.simplejson 的弃用和删除,建议的替代品是内置 json 模块。但是,当像 simplejson 那样使用 dumps() 时,内置函数不会处理 Decimal 字段的编码。使用 django.core.serializers.json.DjangoJSONEncoder

>>> string = json.dumps({"x", Decimal("100.000000")}, cls=DjangoJSONEncoder)
>>> '{"x": "100.000000"}'

似乎在编码之前将小数转换为字符串,而

>>> string = simplejson.dumps({"x", Decimal("100.000000")})
>>> '{"x": 100.000000}'

是否有确切的替代品?

我发现最匹配的似乎是 ujson,它可以很好地处理小数。