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

default_path_serializer()   A

Complexity

Conditions 1

Size

Total Lines 12
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 12
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
from pathlib import PurePath
2
3
4
def default_path_serializer(obj: PurePath, **kwargs) -> str:
5
    """
6
    Serialize a ``pathlib.PurePath`` object to a ``str``, Posix-style.
7
8
    Posix-style strings are used as they can be used to create ``pathlib.Path``
9
    objects on both Posix and Windows systems, but Windows-style strings can
10
    only be used to create valid ``pathlib.Path`` objects on Windows.
11
    :param obj: the path to serialize.
12
    :param kwargs: not used.
13
    :return: a ``str``.
14
    """
15
    return obj.as_posix()
16