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

default_path_deserializer()   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nop 3
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