Total Complexity | 1 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Changes | 0 |
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 |