Skip to content
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

GH-73991: Rework pathlib.Path.rmtree() into delete() #122368

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Jul 27, 2024

Rename pathlib.Path.rmtree() to delete(), and add support for deleting non-directories. This simplifies the interface for users, and nicely complements the upcoming move() and copy() methods (which will also accept any type of file.)


📚 Documentation preview 📚: https://cpython-previews--122368.org.readthedocs.build/

Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `copy()` methods (which will also
accept any type of file.)
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
@barneygale barneygale marked this pull request as ready for review July 29, 2024 00:10
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

Implementation looks fine, only one question

A

Doc/library/pathlib.rst Outdated Show resolved Hide resolved
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
Lib/pathlib/_abc.py Show resolved Hide resolved
@barneygale
Copy link
Contributor Author

@nineteendo I'd welcome your review on this, if you have the time and inclination. No worries if not! Thanks in advance :)

Doc/library/pathlib.rst Outdated Show resolved Hide resolved
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
We generally put the more primitive functions first.
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

Merci beaucoup!

A

@barneygale
Copy link
Contributor Author

Thank you very much for the reviews :)

@barneygale barneygale merged commit 98dba73 into python:main Aug 7, 2024
36 checks passed
@AA-Turner
Copy link
Member

Sorry for my tardiness! Do let me know if there's anything else I can usefully review

A

@barneygale
Copy link
Contributor Author

Not tardy at all I don't think! :]

Do let me know if there's anything else I can usefully review

Since you're offering, the next PR on the critical path here is #122369. But there's a lot going on there, so feel free to give it a miss or ask me to explain it further / break it up / whatever. Thanks again! And feel free to assign me when you next need a review of something.

blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…n#122368)

Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `copy()` methods (which will also
accept any type of file.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants