-
-
Notifications
You must be signed in to change notification settings - Fork 32k
a bit better example in pathlib docs - maybe include example path that involves file in a folder(s)? #120794
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
Comments
Sure, also applies to pure paths: https://docs.python.org/3/library/pathlib.html#pure-paths, which is only seen in normalisation edge cases and unc paths. |
A few more examples wouldn't hurt, e.g. for >>> PosixPath('/etc/hosts')
PosixPath('/etc/hosts')
>>> PosixPath('/home', 'mat', '.profile')
PosixPath('/home/mat/.profile') Happy to review a PR |
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts.
…2887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. Co-authored-by: Adam Turner <[email protected]>
pythonGH-122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. (cherry picked from commit 363374c) Co-authored-by: Barney Gale <[email protected]> Co-authored-by: Adam Turner <[email protected]>
pythonGH-122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. (cherry picked from commit 363374c) Co-authored-by: Barney Gale <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…cs (GH-122887) (#122896) GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. (cherry picked from commit 363374c) Co-authored-by: Barney Gale <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…cs (GH-122887) (#122895) GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. (cherry picked from commit 363374c) Co-authored-by: Barney Gale <[email protected]> Co-authored-by: Adam Turner <[email protected]>
Sorted. Thanks again for reporting, @matkoniecz! |
And thanks for processing suggestion! In many projects such issues are completely ignored, so it was kind of pleasant surprise to see this one actually implemented. It definitely makes me like Python even more. |
python#122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. Co-authored-by: Adam Turner <[email protected]>
Documentation
See https://docs.python.org/3/library/pathlib.html#concrete-paths
Path('setup.py')
andPosixPath('/etc')
andWindowsPath('c:/Program Files/')
both have single level only.Would it be OK to have example with file in a folder? say
PosixPath('/etc/hosts')
(if that is correct way to pass more complex paths to constructor...)Would PR changing this would be welcome and have chances to be reviewed?
Linked PRs
The text was updated successfully, but these errors were encountered: