Conditions | 1 |
Total Lines | 12 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from typing import Optional, Union |
||
5 | def default_decimal_deserializer(obj: Union[str, float, int], |
||
6 | cls: Optional[type] = None, |
||
7 | **kwargs) -> Decimal: |
||
8 | """ |
||
9 | Deserialize a Decimal. Expects a string representation of a number, or |
||
10 | the number itself as a float or int. |
||
11 | :param obj: the string float or int that is to be deserialized. |
||
12 | :param cls: not used. |
||
13 | :param kwargs: any keyword arguments. |
||
14 | :return: the deserialized obj. |
||
15 | """ |
||
16 | return Decimal(obj) |
||
17 |