| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I don't think the behaviour is guaranteed. Can you find it some standard? IMO, it would be better to expand the note about what varies across platforms -- “The full set of format codes”, “handling of unsupported format specifiers”... and also handling of ambiguous/wrong inputs. (Even if all platforms currently agree, I don't think we should commit to their behaviour. As musl shows, there can always appear a new platform that considers it fair game to reinterpret whatever's not specified in C or POSIX.) |
Sorry, something went wrong.
He can choose to do that if he wants, I think the only thing it is hurting is his inbox 😅 WRT the change, I needed a close look to understand what this meant, which makes me think that this is not a very clear statement. It seems like what you are trying to say is something about how ambiguous format specs are parsed, correct? For example, if a code can match one digit or two, and matching two digits will fail to parse but matching one digit will succeed, it chooses one? What if you use %H%M with 111? Does it parse to 11, 1? 1, 11? Fail? How about 131? 071?
I agree in principle. I think if we document this behavior, we should add tests and then maybe add language like, "The behavior when parsing ambiguous strings is platform dependent. On all currently supported platforms, ". We can add a comment to the test to change the documentation if the test starts failing on a supported platform because of their implementation of strptime. (Assuming that this is not already clearly specified in the POSIX standard). |
Sorry, something went wrong.
|
Maybe the wording from the GNU docs would be better?
|
Sorry, something went wrong.
|
I don't think GNU docs have a compatible license, so we should use different wording. |
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
There was a problem hiding this comment.
Looks good!
Sorry, something went wrong.
|
Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
…e` (pythonGH-131049) (cherry picked from commit 2e3e76e) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
…e` (pythonGH-131049) (cherry picked from commit 2e3e76e) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
GH-144734 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
GH-144735 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…e` (pythonGH-131049) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…e` (pythonGH-131049) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…e` (pythonGH-131049) Co-authored-by: Petr Viktorin <encukou@gmail.com>
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--131049.org.readthedocs.build/