[issue42914] pprint numbers with underscore

2021-10-09 Thread Stéphane Blondon
Stéphane Blondon added the comment: Ok, I will not send a PR to change the current behavior until python4 (in case it exists one day). -- ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-10-05 Thread Eric V. Smith
Eric V. Smith added the comment: The safest thing to do is never make it the default. It would always be an opt-in behavior. -- ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-10-05 Thread Stéphane Blondon
Stéphane Blondon added the comment: Python 3.10 has now been released with the underscore_numbers parameter. I wonder which release could enable the parameter by default (so it would break the previous behavior): - the next release (3.11) is probably too short. - the safest strategy is to

[issue42914] pprint numbers with underscore

2021-06-02 Thread miss-islington
miss-islington added the comment: New changeset 41317801a95c758c3fc04c4fb332ac453c9e3ad3 by Miss Islington (bot) in branch '3.10': Add bpo-42914 to What's New (GH-25124) https://github.com/python/cpython/commit/41317801a95c758c3fc04c4fb332ac453c9e3ad3 --

[issue42914] pprint numbers with underscore

2021-06-02 Thread miss-islington
miss-islington added the comment: New changeset 4846ea95d1a121df5e8081e2a290f63d1419cad8 by Wm. Keith van der Meulen in branch 'main': Add bpo-42914 to What's New (GH-25124) https://github.com/python/cpython/commit/4846ea95d1a121df5e8081e2a290f63d1419cad8 -- nosy: +miss-islington

[issue42914] pprint numbers with underscore

2021-06-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +25105 pull_request: https://github.com/python/cpython/pull/26509 ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-03-31 Thread Wm. Keith van der Meulen
Change by Wm. Keith van der Meulen : -- nosy: +wkeithvan nosy_count: 7.0 -> 8.0 pull_requests: +23872 pull_request: https://github.com/python/cpython/pull/25124 ___ Python tracker

[issue42914] pprint numbers with underscore

2021-03-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the contribution Stéphane! I agree that this would be a nice default. We're just being conservative in the pace of default behavior changes. Changing the default could be considered in the future after a few releases with this parameter have

[issue42914] pprint numbers with underscore

2021-03-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 3ba3d513b1e3c63d09cb798b982a9e6c369cea4c by sblondon in branch 'master': bpo-42914: add a pprint underscore_numbers option (GH-24864) https://github.com/python/cpython/commit/3ba3d513b1e3c63d09cb798b982a9e6c369cea4c --

[issue42914] pprint numbers with underscore

2021-03-22 Thread Stéphane Blondon
Stéphane Blondon added the comment: I changed the default to be backward compatible (so underscore_numbers=False). I think it would be better with underscore_numbers enabled by default but I understand the need for stability. Perhaps such break could be done in the future (in version 3.12 or

[issue42914] pprint numbers with underscore

2021-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think underscores can be on by default. It needs to be opt-in to be backwards compatible. -- ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42914] pprint numbers with underscore

2021-03-14 Thread Stéphane Blondon
Stéphane Blondon added the comment: Thank you Felipe for the news! :) I have committed a PR about this issue. Two remarks: - I changed the proposed implementation from 'format(integer, '_d')' to '{:_d}.format(integer)' because the first way raised an exception. (The `format` function was not

[issue42914] pprint numbers with underscore

2021-03-14 Thread Stéphane Blondon
Change by Stéphane Blondon : -- keywords: +patch pull_requests: +23624 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24864 ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-03-09 Thread Felipe
Felipe added the comment: All yours! I'm tied up so won't be able to submit the PR On Thu, 25 Feb 2021 at 10:12, Stéphane Blondon wrote: > > Stéphane Blondon added the comment: > > I add the same idea but later than you, so I'm interested by such feature. > > Felipe: do you want to add a

[issue42914] pprint numbers with underscore

2021-02-25 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42914] pprint numbers with underscore

2021-02-25 Thread Stéphane Blondon
Stéphane Blondon added the comment: I add the same idea but later than you, so I'm interested by such feature. Felipe: do you want to add a pull request to this issue (with Serhiy Storchaka implementation because it's the simplest one)? If not, I plan to write it. I will write it too if

[issue42914] pprint numbers with underscore

2021-01-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> format(10**9, '_d') '1_000_000_000' -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue42914] pprint numbers with underscore

2021-01-13 Thread Eric V. Smith
Eric V. Smith added the comment: +1 also. I agree with Raymond it should be optional. -- nosy: +eric.smith ___ Python tracker ___

[issue42914] pprint numbers with underscore

2021-01-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: > It would be nice if pprint learned to insert underscores in long numbers +1 but I would make this optional. > Here is an implementation of the safe repr for numbers if helpful I suggest using the existing string formatting tools as a foundation

[issue42914] pprint numbers with underscore

2021-01-12 Thread Felipe
Felipe added the comment: Here is an implementation of the safe repr for numbers if helpful: ``` def safe_repr_int(object): sign = '' if object < 0: sign = '-' object = -object r = repr(object) if len(r) <= 4: return sign + r parts = [sign]

[issue42914] pprint numbers with underscore

2021-01-12 Thread Felipe
New submission from Felipe : It would be nice if pprint learned to insert underscores in long numbers Current behavior: >>> pprint.pprint(int(1e9)) 10 Desired behavior >>> pprint.pprint(int(1e9)) 1_000_000_000 Wikipedia tells me that "groups of 3" is the international standard to