Merged
Conversation
Contributor
Author
|
Just played around with this some more: >>> parse.parse("a{:d}sdf{:D}", "a-023sdfasdf")
<Result (-23, 'asdf') {}>
>>> parse.parse("{:D}{:d}sdf{:D}", "a-023sdfasdf")
<Result ('a-', 23, 'asdf') {}>Now the sign lands in :D which is as documented but may be surprising nevertheless. Well in the end one must take more care when parsing than formatting I guess. |
wimglenn
approved these changes
Dec 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In my understanding of the word "digits" the signs + or - would not be matched. That is indeed not the case, you can prefix your numbers with + (optional) or - and it gets matched and converted as one would expect it.
Feel free to treat this as an issue report and reword it in a different way, this is just my attempt to make it more clear.
Thanks for the cool library! ❤️