Allow grouping char (,_) in decimal format string#221
Allow grouping char (,_) in decimal format string#221wimglenn merged 6 commits intor1chardj0n3s:masterfrom
Conversation
| width = "+" | ||
| s = r"\d{w}|[-+ ]?0[xX][0-9a-fA-F]{w}|[-+ ]?0[bB][01]{w}|[-+ ]?0[oO][0-7]{w}".format( | ||
| w=width | ||
| s = r"[-+ ]?[0-9{g}]{w}|[-+ ]?0[xX][0-9a-fA-F{g}]{w}|[-+ ]?0[bB][01{g}]{w}|[-+ ]?0[oO][0-7{g}]{w}".format( |
There was a problem hiding this comment.
I added a [-+ ]? for the base10 part because it seemed missing. I don't know if that is necessary.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #221 +/- ##
==========================================
+ Coverage 94.67% 94.73% +0.05%
==========================================
Files 1 1
Lines 545 551 +6
Branches 128 130 +2
==========================================
+ Hits 516 522 +6
Misses 19 19
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for your quick review and your additions! Is there anything more that I can do? |
|
Seems fine in current form. It's a bit strange that this will still parse the underscore separators in Python 2.7 even though underscore separators were not added for str.format until Py 3.6, but I couldn't imagine how that would actually backwards break anything. |
|
Thanks for merging!
I would assume that it's fine. And, as a user I would be surprised if underscore parsing was explicitly excluded for 2.7 while it is possible with later versions of the package. |
Closes #220.