default_time_deserializer()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
from datetime import time
2
3
from jsons._datetime_impl import get_datetime_inst, RFC3339_TIME_PATTERN
4
5
6
def default_time_deserializer(obj: str,
7
                              cls: type = time,
8
                              **kwargs) -> time:
9
    """
10
    Deserialize a string with an RFC3339 pattern to a time instance.
11
    :param obj: the string that is to be deserialized.
12
    :param cls: not used.
13
    :param kwargs: not used.
14
    :return: a ``datetime.time`` instance.
15
    """
16
    return get_datetime_inst(obj, RFC3339_TIME_PATTERN).time()
17