Stéphane Blondon <stephane.blon...@gmail.com> 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 defined.)
- I thought about adding the same behavior for float too but I didn't add it 
because the '_f' type uses a precision of 6 digits after the decimal point for 
float. So it's possible some precision would be lost with the pprint() call. It 
could mislead users more than helping them with the readability of the '_'. A 
precision value can be added but I'm not sure it's a good idea. based on [1]

As requested, there is a new parameter to disable this new behavior 
('underscore_numbers').


1: 
https://docs.python.org/3/library/string.html#format-specification-mini-language

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42914>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to