New submission from Mark Dickinson <dicki...@gmail.com>: Python's old-style formatting supports the use of an alternative form (specified by including a '#' in the format) for 'e', 'f' and 'g' formatting:
Python 3.2a0 (py3k:75275:75276, Oct 7 2009, 20:26:36) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '%.17g' % 1.2 '1.2' >>> '%#.17g' % 1.2 '1.2000000000000000' New-style formatting doesn't currently support this: >>> format(1.2, '#.17g') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Alternate form (#) not allowed in float format specifier To aid migration from old-style to new-style formatting, it might be worth adding the alternate forms. At least the float, complex and Decimal types would be affected. ---------- components: Interpreter Core messages: 93807 nosy: eric.smith, mark.dickinson severity: normal stage: test needed status: open title: Add alternate float formatting styles to new-style formatting. type: feature request versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7094> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com