This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sblondon
Recipients eric.smith, fov, mark.dickinson, rhettinger, sblondon, serhiy.storchaka
Date 2021-03-14.22:42:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615761773.47.0.408491956373.issue42914@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-03-14 22:42:53sblondonsetrecipients: + sblondon, rhettinger, mark.dickinson, eric.smith, serhiy.storchaka, fov
2021-03-14 22:42:53sblondonsetmessageid: <1615761773.47.0.408491956373.issue42914@roundup.psfhosted.org>
2021-03-14 22:42:53sblondonlinkissue42914 messages
2021-03-14 22:42:53sblondoncreate