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

jsons.serializers.default_iterable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A default_iterable_serializer() 0 9 1
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