Skip to content

GH-125413: Revert addition of pathlib.Path.scandir() method #127377

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 4 commits into from
Dec 5, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Nov 29, 2024

Remove documentation for pathlib.Path.scandir(), and rename the method to _scandir(). In the private pathlib ABCs, make iterdir() abstract and call it from _scandir().

It's not worthwhile to add this method at the moment - see discussion: https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721


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

Remove documentation for `pathlib.Path.scandir()`, and rename the method to
`_scandir()`. In the private pathlib ABCs, make `iterdir()` abstract and
call it from `_scandir()`.

It's not worthwhile to add this method at the moment - see discussion:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721
@barneygale barneygale requested a review from zooba November 29, 2024 01:26
Copy link
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

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

Sorry, I think we need a bit more code duplication in order to keep subclassing reliable.

@barneygale
Copy link
Contributor Author

@zooba would you mind if I tackle removing _scandir() in a follow-up PR?

@zooba
Copy link
Member

zooba commented Dec 5, 2024

Sure. Provided it's not part of the public/subclassing interface, I'm happy.

@barneygale barneygale requested a review from zooba December 5, 2024 21:27
@barneygale barneygale enabled auto-merge (squash) December 5, 2024 21:36
@barneygale barneygale merged commit 8b3cccf into python:main Dec 5, 2024
42 checks passed
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…ython#127377)

Remove documentation for `pathlib.Path.scandir()`, and rename the method to
`_scandir()`. In the private pathlib ABCs, make `iterdir()` abstract and
call it from `_scandir()`.

It's not worthwhile to add this method at the moment - see discussion:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721

Co-authored-by: Steve Dower <[email protected]>
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.

2 participants