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

Mark Dickinson report at bugs.python.org
Mon Apr 27 19:04:15 CEST 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I think a ValueError would be best. That way if we decide to give it
> some meaning in the future, we know it won't change any working code.

Agreed.  It also fits with the way that other non-numeric types seem to 
behave, as in:

>>> format("boris", "030s")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: '=' alignment not allowed in string format specifier

----------

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


More information about the Python-bugs-list mailing list