Visitar URL original
bpo-46148: optimize `pathlib.Path.iterdir()` by barneygale · Pull Request #30492 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20251017021020/https://github.com/python/cpython/pull/30492
Skip to content

Conversation

barneygale
Copy link
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
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
Contributor Author

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

@barneygale barneygale closed this Jan 9, 2022
@barneygale
Copy link
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