GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — GH-101112: Add "pattern language" section to pathlib docs by barneygale · Pull Request #114030 · python/cpython Conversation
|
|
How patterns with trailing slashes should work:
However pathlib's implementation of globbing only supports (1), and it's more-or-less impossible to support (2) and (3) in a backwards-compatible way. Because of this, I've not documented trailing slashes in this PR. Too many caveats. They get a mention in the See also: #106747 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Maybe it's worth mentioning that trailing slashes are currently inconsistent and to check individual docs, but also recommend a way to use them consistently so that as we make fixes, you're less likely to be affected? e.g. if we'd been telling people "yeah, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Honestly I think it's a dead end given the strength of feeling in this thread: https://discuss.python.org/t/pathlib-preserve-trailing-slash/33389 The only possible avenue I see is that we introduce a new class like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
By the logic I see there, Since we're talking about a pattern here, rather than a path, I think it's okay for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I agree that making trailing slashes meaningful to patterns in ... but at least it only affects |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've added a couple of paragraphs that attempts to explain how trailing slashes work, lmk what you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Is it worth adding a "Comparison to
It could also note that pathlib's implementation is heckin' fast |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Few minor suggestions, but looks good.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for the review, Steve. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…on#114030) Explain the `full_match()` / `glob()` / `rglob()` pattern language in its own section. Move `rglob()` documentation under `glob()` and reduce duplicated text.
…on#114030) Explain the `full_match()` / `glob()` / `rglob()` pattern language in its own section. Move `rglob()` documentation under `glob()` and reduce duplicated text.
…on#114030) Explain the `full_match()` / `glob()` / `rglob()` pattern language in its own section. Move `rglob()` documentation under `glob()` and reduce duplicated text.
…on#114030) Explain the `full_match()` / `glob()` / `rglob()` pattern language in its own section. Move `rglob()` documentation under `glob()` and reduce duplicated text.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.