| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Expand Up | @@ -298,10 +298,10 @@ the :mod:`glob` module.) | |||||||||||||||||||||
| .. function:: join(path, *paths) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Join one or more path components intelligently. The return value is the | ||||||||||||||||||||||
| concatenation of *path* and any members of *\*paths* with exactly one | ||||||||||||||||||||||
| directory separator following each non-empty part except the last, meaning | ||||||||||||||||||||||
| that the result will only end in a separator if the last part is empty. If | ||||||||||||||||||||||
| a component is an absolute path, all previous components are thrown away | ||||||||||||||||||||||
| concatenation of *path* and any non-empty members of *\*paths* separated | ||||||||||||||||||||||
| by the platform's directory separator character. If the last member of *\*paths* | ||||||||||||||||||||||
| is empty, the result will end in the platform's directory separator. | ||||||||||||||||||||||
|
Comment thread
Comment on lines
+302
to
+303
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@serhiy-storchaka Revisiting this, here's one alternative wording without introducing new terms:
Suggested change
That would keep the idea of the original (but incorrect) note of the result will only end in a separator if the last part is empty. If dropping the note entirely is preferred, then I'll happily defer judgement here and in that case feel free to commit the below suggestion instead:
Suggested change
Sorry, something went wrong.
All reactions
|
||||||||||||||||||||||
| If a component is an absolute path, all previous components are thrown away | ||||||||||||||||||||||
| and joining continues from the absolute path component. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| On Windows, the drive letter is not reset when an absolute path component | ||||||||||||||||||||||
| Expand Down | ||||||||||||||||||||||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityMade this part a bit more specific, but can use original suggested wording if wanted
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIt is not true. For example, os.path.join('', '') -> ''. On Windows, os.path.join('c:', '') -> 'c:'.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThat's a good point. Then perhaps instead, is empty, and if *path* is not a root dir or empty, then .... It can also be optionally less specific, and say, ... the result will generally end in the ....
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIt is problematic, because the term "root dir" needs explanation, especially on Windows.
What if just say that empty members are ignored, except the last one?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIf it needs some explanation, then maybe we give a quick example and phrase it as "... and if path is a root directory (i.e., / or c:) or empty, then ..."
For your second statement, do you mean leaving out the note on platform separators? It seems a bit too noteworthy to leave it out though. It could be phrased differently like,
If the last element of paths is empty, the result will end in the platform's directory separator, unless path is empty or a root directory.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI afraid that it would be too verbose and still not clear. It is not good place to introduce a new term, especially if it may conflict with the meaning in other sites.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI see, you would prefer to keep it a bit vague, like The return value is the concatenation of *path* and any non-empty members of *paths* separated by the platform's directory separator character. Empty members of *paths* are ignored except for the last path. If a component is an absolute path, ...?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.