FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-125413: Revert addition of `pathlib.Path.scandir()` method by barneygale · Pull Request #127377 · python/cpython · GitHub

/ cpython Public

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

Merged
barneygale merged 4 commits into
python:mainfrom
barneygale:scandir-revert
Dec 5, 2024
Merged

GH-125413: Revert addition of pathlib.Path.scandir() method#127377
barneygale merged 4 commits into
python:mainfrom
barneygale:scandir-revert

Conversation

barneygale commented Nov 29, 2024
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

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 requested a review from zooba November 29, 2024 01:26

zooba left a comment

Copy link
Copy Markdown
Member

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

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

Comment thread Lib/pathlib/_abc.py
Comment thread Lib/pathlib/_abc.py
Comment thread Lib/pathlib/_abc.py

Copy link
Copy Markdown
Contributor Author

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

zooba commented Dec 5, 2024

Copy link
Copy Markdown
Member

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

barneygale and others added 2 commits December 5, 2024 21:11
…CN0vv.rst

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
barneygale requested a review from zooba December 5, 2024 21:27
barneygale enabled auto-merge (squash) December 5, 2024 21:36
barneygale merged commit 8b3cccf into python:main Dec 5, 2024
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>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL