Decimal
decimal.Decimal
is serialized as string types.
To serialize Decimal
,
>>> perde.json.dumps(decimal.Decimal('3.14159265'))
'"3.14159265"'
To deserialize Decimal
,
>>> perde.json.loads_as(decimal.Decimal, '"3.14159265"')
Decimal('3.14159265')