← 返回首页
bpo-34526:[doc] Add description and examples of multiple arguments for Path.relative_to by lvluling · Pull Request #31368 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-34526:[doc] Add description and examples of multiple arguments for Path.relative_to#31368

Closed
lvluling wants to merge 1 commit into
python:mainfrom
lvluling:bpo-34526-relative_to
Closed

bpo-34526:[doc] Add description and examples of multiple arguments for Path.relative_to#31368
lvluling wants to merge 1 commit into
python:mainfrom
lvluling:bpo-34526-relative_to

Conversation

lvluling commented Feb 16, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown

the docs for Path.relative_to is a bit confusing why other is a star-args, especially as no example actually passes more than one argument to relative_to

https://bugs.python.org/issue34526

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@lvluling

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Comment thread Doc/library/pathlib.rst
*other*. If it's impossible, ValueError is raised::
Return the relative path to another path identified by *other*, each
element of *other* can be either a string representing a path segment,
or another path object implementing the :class:`PurePath`(or a subclass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Thanks. You missed the definition of class PurePath in the context, it could be changed from :class:PurePath to the class PurePath.

Copy link
Copy Markdown
Member

@barneygale would you be able to review this PR?

barneygale commented May 2, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

I've left a comment on the #78707. I don't think relative_to() and is_relative_to() should accept multiple arguments - I'd rather we restricted this to methods that explicitly deal with path construction - PurePath() and PurePath.joinpath().

Copy link
Copy Markdown
Contributor

In #94469 we deprecated passing multiple positional arguments to relative_to(), so I think this patch is no longer valid. Thank you for working on it all the same!

barneygale closed this Jan 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

Footer

© 2026 GitHub, Inc.