[issue1588] str.format() wrongly formats complex() numbers (Py30a2)

Eric Smith report at bugs.python.org
Tue Apr 28 12:56:21 CEST 2009


Eric Smith <eric at trueblade.com> added the comment:

See the attached patch. Comments welcome.

I'm not sure I'm doing the right thing with 'g' and appending zeros:
>>> format(3+4j, '.2')
'(3+4j)'
>>> format(3+4j, '.2g')
'3.0+4.0j'
>>> format(3+0j, '.2')
'(3+0j)'
>>> format(3+0j, '.2g')
'3.0+0.0j'
>>> format(1j, '.2')
'(1j)'
>>> format(1j, '.2g')
'0.0+1.0j'

----------
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file13801/issue-1588-0.patch

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


More information about the Python-bugs-list mailing list