Passed
Pull Request — master (#17)
by Ramon
50s
created

default_iterable_serializer()   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
from jsons._main_impl import dump
2
3
4
def default_iterable_serializer(obj: object, **kwargs) -> list:
5
    """
6
    Serialize the given ``obj`` to a list of serialized objects.
7
    :param obj: the iterable that is to be serialized.
8
    :param kwargs: any keyword arguments that may be given to the serialization
9
    process.
10
    :return: a list of which all elements are serialized.
11
    """
12
    return [dump(elem, **kwargs) for elem in obj]
13