-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-78318: Add pathlib.Path.lexists and related #21157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This looks fine to me (note: I'm just some guy, not a core dev) I'd argue that we're adding two ways to do the same thing ( |
@barneygale You're right that |
Resolving conflicts. |
0cf7578
to
f4f3805
Compare
The difference is that |
I think you mean that they are standard library calls, neither have been syscalls in a long while (at least on Linux). My motivation, however, wasn't to make people coming from a POSIX-compliant C library "feel at home", but old fogies like me who're used to the |
This adds the `follow_symlink` parameter to `pathlib.Path.exists()`, and wraps the new functionality in `pathlib.Path.lexists()`, analogous to `os.stat()` ./. `os.lstat()` and `os.path.exists()` ./. `os.path.lexists()`. GH-NNNN Signed-off-by: Nils Philippsen <nils@tiptoe.de>
f4f3805
to
d48d796
Compare
I'm still -1 on this, per Zen of Python's "There should be one -- and preferably only one -- obvious way to do it." I'd rather we didn't have |
Ah, I misinterpreted your "This looks fine to me" earlier comment :) In that case, let's close this. There seems to have been little interest in the issue or the PR in the four-and-a-half years since the issue was opened, and the bar for additions to the stdlib is (quite rightly) high. Thanks for the PR @nphilipp -- I hope this doesn't discourage you from contributing to CPython in the future! |
This adds the
follow_symlink
parameter topathlib.Path.exists()
,and wraps the new functionality in
pathlib.Path.lexists()
, analogousto
os.stat()
./.os.lstat()
andos.path.exists()
./.os.path.lexists()
.Signed-off-by: Nils Philippsen nils@tiptoe.de