| Conditions | 1 |
| Total Lines | 10 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from typing import Literal, Any |
||
| 5 | def default_literal_serializer(obj: Any, cls: Literal, **kwargs): |
||
| 6 | """ |
||
| 7 | Serialize an object to its value. |
||
| 8 | :param obj: The object that is to be serialized. |
||
| 9 | :param cls: The Literal type with values (e.g. Union[1, 2]). Not used. |
||
| 10 | :param kwargs: Any keyword arguments that are passed through the |
||
| 11 | serialization process. |
||
| 12 | :return: The serialized object. |
||
| 13 | """ |
||
| 14 | return dump(obj, type(obj), **kwargs) |
||
| 15 |