GH-127381: pathlib ABCs: remove PathBase.lstat() (#127382)

Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.

No user-facing changes because the pathlib ABCs are still private.
This commit is contained in:
Barney Gale 2024-11-29 21:03:39 +00:00 committed by GitHub
parent 15d6506d17
commit 38264a060a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 29 deletions

View file

@ -542,6 +542,13 @@ class Path(PathBase, PurePath):
"""
return os.stat(self, follow_symlinks=follow_symlinks)
def lstat(self):
"""
Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's.
"""
return os.lstat(self)
def exists(self, *, follow_symlinks=True):
"""
Whether this path exists.