MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/pathlib/__init__.py:135–155  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

133 return object.__new__(cls)
134
135 def __init__(self, *args):
136 paths = []
137 for arg in args:
138 if isinstance(arg, PurePath):
139 if arg.parser is not self.parser:
140 # GH-103631: Convert separators for backwards compatibility.
141 paths.append(arg.as_posix())
142 else:
143 paths.extend(arg._raw_paths)
144 else:
145 try:
146 path = os.fspath(arg)
147 except TypeError:
148 path = arg
149 if not isinstance(path, str):
150 raise TypeError(
151 "argument should be a str or an os.PathLike "
152 "object where __fspath__ returns a str, "
153 f"not {type(path).__name__!r}")
154 paths.append(path)
155 self._raw_paths = paths
156
157 def with_segments(self, *pathsegments):
158 """Construct a new path object from any number of path-like objects.

Callers

nothing calls this directly

Calls 4

isinstanceFunction · 0.85
as_posixMethod · 0.80
appendMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected