Closed eisensheng closed 12 years ago
Json parsers allow a custom type to be used for parsing float values. It is common practice to use Decimal as float storage to prevent precision loss.
Example:
parsed_data = json.loads(raw_data, parse_float=Decimal) validictory.validate(parsed_data, SCHEMA)
would fail horrible with now option to allow Decimal to be used.
A better approach would be to extend the API and allow users to specify which types are allowed in which case. This commit fixes my current issue with Decimal though.
thanks for this, what name would you like to be credited under?
Json parsers allow a custom type to be used for parsing float values. It is common practice to use Decimal as float storage to prevent precision loss.
Example:
would fail horrible with now option to allow Decimal to be used.
A better approach would be to extend the API and allow users to specify which types are allowed in which case. This commit fixes my current issue with Decimal though.