jsons.deserializers.default_time   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Function

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