Completed
Push — master ( 919d86...33db6d )
by Ramon
23s queued 10s
created

jsons.deserializers.default_path   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_path_deserializer() 0 9 1
1
from pathlib import PurePath
2
3
4
def default_path_deserializer(obj: str, cls: type = PurePath, **kwargs) -> PurePath:
5
    """
6
    Deserialize a string to a `pathlib.PurePath` object. Since ``pathlib``
7
    implements ``PurePath``, no filename or existence checks are performed.
8
    :param obj: the string to deserialize.
9
    :param kwargs: not used.
10
    :return: a ``str``.
11
    """
12
    return cls(obj)
13