Extend :func:`xopen` to support argument of type :obj:`~pathlib.Path`. Args: **args: Arguments passed to :func:`fsspec.open`. **kwargs: Keyword arguments passed to :func:`fsspec.open`. Returns: `io.FileIO`: File-like object.
(self, *args, **kwargs)
| 1189 | return PurePosixPath(self.as_posix().split("::")[0]).suffix |
| 1190 | |
| 1191 | def open(self, *args, **kwargs): |
| 1192 | """Extend :func:`xopen` to support argument of type :obj:`~pathlib.Path`. |
| 1193 | |
| 1194 | Args: |
| 1195 | **args: Arguments passed to :func:`fsspec.open`. |
| 1196 | **kwargs: Keyword arguments passed to :func:`fsspec.open`. |
| 1197 | |
| 1198 | Returns: |
| 1199 | `io.FileIO`: File-like object. |
| 1200 | """ |
| 1201 | return xopen(str(self), *args, **kwargs) |
| 1202 | |
| 1203 | def joinpath(self, *p: tuple[str, ...]) -> "xPath": |
| 1204 | """Extend :func:`xjoin` to support argument of type :obj:`~pathlib.Path`. |