10000 [3.12] gh-117074: Update Traversable.joinpath docs to the 3.11+ protocol (GH-117113) by miss-islington · Pull Request #117571 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-117074: Update Traversable.joinpath docs to the 3.11+ protocol (GH-117113) 8000 #117571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions Doc/library/importlib.resources.abc.rst
88DC
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,35 @@

Return True if self is a file.

.. abstractmethod:: joinpath(child)
.. abstractmethod:: joinpath(*pathsegments)

Return Traversable child in self.
Traverse directories according to *pathsegments* and return
the result as :class:`!Traversable`.

Each *pathsegments* argument may contain multiple names separated by
forward slashes (``/``, ``posixpath.sep`` ).
For example, the following are equivalent::

files.joinpath('subdir', 'subsuddir', 'file.txt')
files.joinpath('subdir/subsuddir/file.txt')

Note that some :class:`!Traversable` implementations
might not be updated to the latest version of the protocol.
For compatibility with such implementations, provide a single argument
without path separators to each call to ``joinpath``. For example::

files.joinpath('subdir').joinpath('subsubdir').joinpath('file.txt')

.. versionchanged:: 3.11

``joinpath`` accepts multiple *pathsegments*, and these segments
may contain forward slashes as path separators.
Previously, only a single *child* argument was accepted.

.. abstractmethod:: __truediv__(child)

Return Traversable child in self.
Equivalent to ``joinpath(child)``.

.. abstractmethod:: open(mode='r', *args, **kwargs)

Expand Down
0