| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…stat()` Since 6258844, paths that might not exist can be fed into pathlib's globbing implementation, which will call `os.scandir()` / `os.lstat()` only when strictly necessary. This allows us to drop an initial `self.is_dir()` call, which saves a `stat()`.
There was a problem hiding this comment.
Since this was previously explicitly documented, should this have a versionchanged in the docs? Oh hmm, I guess this was just documented recently in #114036 by you, so it's probably fine... :-)
I also wonder if we can improve tests, e.g. it looks like the if not self.is_dir(): branch was not covered by tests
Sorry, something went wrong.
|
Thanks! I think it's probably not important enough for .. versionchanged::, particularly as we don't document the sorts of OSError that are raised or suppressed from is_dir(). |
Sorry, something went wrong.
…xoM03.rst Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
|
On reflection, I think this works best as a .. versionchanged:: directive. Thank you for the pointer :) |
Sorry, something went wrong.
…stat()` (python#117831) Since 6258844, paths that might not exist can be fed into pathlib's globbing implementation, which will call `os.scandir()` / `os.lstat()` only when strictly necessary. This allows us to drop an initial `self.is_dir()` call, which saves a `stat()`. Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Since 6258844, paths that might not exist can be fed into pathlib's globbing implementation, which will call os.scandir() / os.lstat() only when strictly necessary. This allows us to drop an initial self.is_dir() call, which saves a stat().
📚 Documentation preview 📚: https://cpython-previews--117831.org.readthedocs.build/