jsons.deserializers.default_uuid   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_uuid_deserializer() 0 12 1
1
from typing import Optional
2
from uuid import UUID
3
4
5
def default_uuid_deserializer(obj: str,
6
                              cls: Optional[type] = None,
7
                              **kwargs) -> UUID:
8
    """
9
    Deserialize a UUID. Expected format for string is specified in RFC 4122.
10
    e.g. '12345678-1234-1234-1234-123456789abc'
11
    :param obj: the string that is to be deserialized.
12
    :param cls: not used.
13
    :param kwargs: any keyword arguments.
14
    :return: the deserialized obj.
15
    """
16
    return UUID(obj)
17