Author mark.dickinson
Recipients eric.smith, mark.dickinson
Date 2009-10-09.19:54:02
SpamBayes Score 1.05305e-13
Marked as misclassified No
Message-id <>
Python's old-style formatting supports the use of an alternative form 
(specified by including a '#' in the format) for 'e', 'f' and 'g' 

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
>>> '%#.17g' % 1.2

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.
Date User Action Args
2009-10-09 19:54:04mark.dickinsonsetrecipients: + mark.dickinson, eric.smith
2009-10-09 19:54:04mark.dickinsonsetmessageid: <>
2009-10-09 19:54:03mark.dickinsonlinkissue7094 messages
2009-10-09 19:54:02mark.dickinsoncreate