msg266023 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2016-05-21 20:38 |
I've separated this out from issue 26331, so as to not interfere with discussions and code reviews for the parsing portion of the PEP. |
|
|
msg273093 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2016-08-19 08:23 |
Unfortunately I'm not going to have time to implement this before 3.6 beta 1, so I'm un-assigning it to myself. I'll post to python-dev and hopefully someone else can get to it. Apologies for waiting so long. |
|
|
msg273117 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2016-08-19 13:24 |
Here's a first-cut patch. No docs, no tests, and applies only to decimal formatting. It involves redefining the thousands_separators flag from being a boolean to being a three-state flag (none, comma, or underscore), and (ab)uses LT_*_LOCALE to carry that same information around. |
|
|
msg273120 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2016-08-19 13:34 |
Hmm, adding bin/oct/hex support didn't turn out that hard. Although it feels like this code is getting hackish. Definitely needs code review! |
|
|
msg273123 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2016-08-19 13:52 |
Hmm, strange. Comma formatting never seems to have had tests added. So I've added a couple of simple tests of comma formatting at the same time as adding underscore formatting tests. Also, test_long.py currently has a comment "# octal" preceding a bunch of tests of *binary* formatting, and no tests of octal. So I've added those too. In any case, here's a patch with full functionality and tests. |
|
|
msg274769 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2016-09-07 06:33 |
Another couple of tests, per comments. |
|
|
msg275150 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-09-08 20:48 |
Latest patch LGTM. If Georg isn't able to get to issue #26331 then I'll commit to tomorrow. Do you want me to commit yours on your behalf right after, Chris to make sure this hits b1? |
|
|
msg275151 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-09-08 20:48 |
Actually, Chris doesn't have commit privileges so I just will. :) |
|
|
msg275165 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2016-09-08 21:28 |
Thanks Brett! Sounds like a plan. |
|
|
msg275367 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2016-09-09 18:11 |
Since Brett is working on the parsing part, I'll work on this. I might take a stab at the documentation first, but in any event I'll commit it tonight. |
|
|
msg275545 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2016-09-10 02:28 |
I just noticed that the patch doesn't handle 'X' (uppercase) correctly, while it does handle 'x' (lowercase). I'll fix that when I commit. |
|
|
msg275549 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-10 03:07 |
New changeset 99abb731ea7a by Eric V. Smith in branch 'default': Issue 27080: PEP 515: add '_' formatting option. https://hg.python.org/cpython/rev/99abb731ea7a |
|
|
msg275550 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2016-09-10 03:08 |
I also fixed the code so both '_' and ',' can't be specified, and added tests. The documentation is also updated. |
|
|