mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Add `pathlib.Path.info` attribute, which stores an object implementing the `pathlib.types.PathInfo` protocol (also new). The object supports querying the file type and internally caching `os.stat()` results. Path objects generated by `Path.iterdir()` are initialised with status information from `os.DirEntry` objects, which is gleaned from scanning the parent directory. The `PathInfo` protocol has four methods: `exists()`, `is_dir()`, `is_file()` and `is_symlink()`. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _abc.py | ||
| _local.py | ||
| _os.py | ||
| types.py | ||