Skip to content

Conversation

@barneygale
Copy link
Contributor

@barneygalebarneygale 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
Copy link
Member

@zoobazooba 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
ContributorAuthor

@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.

barneygaleand others added 2 commits December 5, 2024 21:11
…CN0vv.rst Co-authored-by: Steve Dower <steve.dower@microsoft.com>
@barneygalebarneygale requested a review from zoobaDecember 5, 2024 21:27
@barneygalebarneygale enabled auto-merge (squash) December 5, 2024 21:36
@barneygalebarneygale merged commit 8b3cccf into python:mainDec 5, 2024
38 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 <steve.dower@microsoft.com>
Sign up for freeto 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

@barneygale@zooba