| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from typing import Union |
||
| 6 | def default_tuple_serializer(obj: tuple, **kwargs) -> Union[list, dict]: |
||
| 7 | """ |
||
| 8 | Serialize the given ``obj`` to a list of serialized objects. |
||
| 9 | :param obj: the tuple that is to be serialized. |
||
| 10 | :param kwargs: any keyword arguments that may be given to the serialization |
||
| 11 | process. |
||
| 12 | :return: a list of which all elements are serialized. |
||
| 13 | """ |
||
| 14 | if hasattr(obj, '_fields'): |
||
| 15 | return default_namedtuple_serializer(obj, **kwargs) |
||
| 16 | return default_iterable_serializer(obj, **kwargs) |
||
| 17 | |||
| 30 |