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 John Belmonte
Recipients John Belmonte, eric.smith, mark.dickinson, serhiy.storchaka, steven.daprano
Date 2021-12-07.12:22:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638879734.81.0.73384551894.issue45995@roundup.psfhosted.org>
In-reply-to
Content
> changing %-formatting doesn't seem viable

I'm concerned about treating %-formatting specially.  As far as float/complex, the logical and efficient place to put this change seems to be PyOS_double_to_string(), which affects all three formatting options.

For example, the dtoa case is as simple as this change to format_float_short():

    /* coerce negative zero to positive */
    if (sign == 1 && ((digits_len == 0 && decpt == -1) ||
                      (digits_len == 1 && digits[0] == '0'))) {
        sign = 0;
    }
History
Date User Action Args
2021-12-07 12:22:14John Belmontesetrecipients: + John Belmonte, mark.dickinson, eric.smith, steven.daprano, serhiy.storchaka
2021-12-07 12:22:14John Belmontesetmessageid: <1638879734.81.0.73384551894.issue45995@roundup.psfhosted.org>
2021-12-07 12:22:14John Belmontelinkissue45995 messages
2021-12-07 12:22:14John Belmontecreate