Completed
Push — master ( 8f3758...257d3c )
by Ramon
29s queued 11s
created

default_complex_serializer()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
def default_complex_serializer(obj: complex, **_) -> dict:
2
    """
3
    Serialize a complex as a dict.
4
    :param obj: the complex.
5
    :param _: not used.
6
    :return: a ``dict``.
7
    """
8
    return {'real': obj.real, 'imag': obj.imag}
9