Build a user-facing dunder path string from a pre-split tuple, optionally appending one extra segment. Used only for error messages — the rest of the module keeps paths as tuples. :param parts: pre-split path segments :type parts: PathParts :param tail: optional additional
(parts: PathParts, tail: Optional[str] = None)
| 837 | |
| 838 | |
| 839 | def join_path(parts: PathParts, tail: Optional[str] = None) -> str: |
| 840 | """ |
| 841 | Build a user-facing dunder path string from a pre-split tuple, optionally |
| 842 | appending one extra segment. Used only for error messages — the rest of |
| 843 | the module keeps paths as tuples. |
| 844 | |
| 845 | :param parts: pre-split path segments |
| 846 | :type parts: PathParts |
| 847 | :param tail: optional additional segment to append |
| 848 | :type tail: Optional[str] |
| 849 | :return: dunder-joined path string |
| 850 | :rtype: str |
| 851 | """ |
| 852 | if tail is None: |
| 853 | return "__".join(parts) |
| 854 | return "__".join(parts + (tail,)) if parts else tail |
no outgoing calls
no test coverage detected