cpython
cpython copied to clipboard
gh-136059: docs: pathlib: Mention that iterdir() is surprisingly not streaming
This undocumented gotcha can cause excessive memory usage when "iterating" over very large directories.
This is because iterdir() does
entries = list(scandir_it)
Fixing (if at all desired) will likel need least significant amounts of discussion and testing, so first document the behaviour.
See:
- #136059
- Issue: gh-136059
📚 Documentation preview 📚: https://cpython-previews--136060.org.readthedocs.build/