Skip to content

bpo-46148: optimize pathlib.Path.iterdir()#30492

Closed
barneygale wants to merge 1 commit intopython:mainfrom
barneygale:bpo-46148-optimize-pathlib-path-iterdir
Closed

bpo-46148: optimize pathlib.Path.iterdir()#30492
barneygale wants to merge 1 commit intopython:mainfrom
barneygale:bpo-46148-optimize-pathlib-path-iterdir

Conversation

@barneygale
Copy link
Copy Markdown
Contributor

@barneygale barneygale commented Jan 9, 2022

os.listdir() doesn't return entries for . or .., so we don't need to
check for them here.

https://bugs.python.org/issue46148

`os.listdir()` doesn't return entries for `.` or `..`, so we don't need to
check for them here.
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

However, I think it needs a new issue, because the one you link is closed. And it didn't state anything about the problem you are fixing.

I think this might be useful for the new issue:

https://docs.python.org/3/library/os.html#os.listdir

Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order, and does not include the special entries '.' and '..' even if they are present in the directory.

You would also need to add a NEWS file. See https://github.com/larryhastings/blurb or https://blurb-it.herokuapp.com/

@AlexWaygood AlexWaygood added the performance Performance or resource usage label Jan 9, 2022
@barneygale
Copy link
Copy Markdown
Contributor Author

Thanks - I'll close this PR and re-create.

@barneygale barneygale closed this Jan 9, 2022
@barneygale
Copy link
Copy Markdown
Contributor Author

New PR: #30501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review performance Performance or resource usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants