Repository navigation
bpo-323042: Document how to remove a suffix of a pathlib.Path - #8655
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request You can check yourself Thanks again for your contribution, we look forward to reviewing it! |
berkerpeksag
left a comment
There was a problem hiding this comment.
Could you also remove the outdated comment in Lib/pathlib.py?
# XXX if suffix is None, should the current suffix be removed?|
Sure. I also documented the empty string case in the docstring. |
There was a problem hiding this comment.
Style nit: We don't use reST markup in docstrings.
6b7a3e7 to
7a8d530
Compare
|
Thanks for the feedback! FYI: In some places in pathlib.py rst-style comments are used. One could clean that up at some point. |
|
Should I squash the commits or is any other action required from my side? |
|
Thanks @sotte for the PR, and @berkerpeksag for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
GH-8661 is a backport of this pull request to the 3.7 branch. |
|
GH-8662 is a backport of this pull request to the 3.6 branch. |
(cherry picked from commit 46dc4e3) Co-authored-by: Stefan Otte <stefan.otte@gmail.com>
(cherry picked from commit 46dc4e3) Co-authored-by: Stefan Otte <stefan.otte@gmail.com>
|
Thanks!
No, I was just waiting for tests to be completed. |
|
Thanks! Was a lot of fun :) |
bpo-323042: Document how to remove a suffix of a pathlib.Path
I didn't realize that you can remove a suffix with the
with_suffixfunction of thePathclass ofpathliband I always used a little utility function that I wrote.I wanted to add that functionality (removing of a suffix) and submit a PR but then I saw that
with_suffixhas you covered already. I'm just documenting this feature with this PR.https://bugs.python.org/issue323042