[New-bugs-announce] [issue5782] ', ' formatting with empty format type '' (PEP 378)

Eric Smith report at bugs.python.org
Fri Apr 17 16:38:03 CEST 2009


New submission from Eric Smith <eric at trueblade.com>:

PEP 378 says that the ',' format option applies to types 'd', 'e', 'f',
'g', 'E', 'G', '%' and 'F'. I think this should also be extended to
include the empty type ''.

This only makes a difference for floats. For ints, '' is the same as
'd', but for floats '' is distinct. In 3.1 we get this behavior:

>>> format(1.2, '010.2')
'00000001.2'
>>> format(1.2, '010,.2')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Cannot specify ',' with ''.

I think the second example should be valid.

----------
assignee: eric.smith
components: Interpreter Core
keywords: easy
messages: 86075
nosy: eric.smith, marketdickinson, rhettinger
priority: normal
severity: normal
status: open
title: ',' formatting with empty format type '' (PEP 378)
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5782>
_______________________________________


More information about the New-bugs-announce mailing list