|
109 | 109 |
|
110 | 110 | Return True if self is a file.
|
111 | 111 |
|
112 |
| - .. abstractmethod:: joinpath(child) |
| 112 | + .. abstractmethod:: joinpath(*pathsegments) |
113 | 113 |
|
114 |
| - Return Traversable child in self. |
| 114 | + Traverse directories according to *pathsegments* and return |
| 115 | + the result as :class:`!Traversable`. |
| 116 | + |
| 117 | + Each *pathsegments* argument may contain multiple names separated by |
| 118 | + forward slashes (``/``, ``posixpath.sep`` ). |
| 119 | + For example, the following are equivalent:: |
| 120 | + |
| 121 | + files.joinpath('subdir', 'subsuddir', 'file.txt') |
| 122 | + files.joinpath('subdir/subsuddir/file.txt') |
| 123 | + |
| 124 | + Note that some :class:`!Traversable` implementations |
| 125 | + might not be updated to the latest version of the protocol. |
| 126 | + For compatibility with such implementations, provide a single argument |
| 127 | + without path separators to each call to ``joinpath``. For example:: |
| 128 | + |
| 129 | + files.joinpath('subdir').joinpath('subsubdir').joinpath('file.txt') |
| 130 | + |
| 131 | + .. versionchanged:: 3.11 |
| 132 | + |
| 133 | + ``joinpath`` accepts multiple *pathsegments*, and these segments |
| 134 | + may contain forward slashes as path separators. |
| 135 | + Previously, only a single *child* argument was accepted. |
115 | 136 |
|
116 | 137 | .. abstractmethod:: __truediv__(child)
|
117 | 138 |
|
118 | 139 | Return Traversable child in self.
|
| 140 | + Equivalent to ``joinpath(child)``. |
119 | 141 |
|
120 | 142 | .. abstractmethod:: open(mode='r', *args, **kwargs)
|
121 | 143 |
|
|
0 commit comments