[issue6850] decimal.py: format_dict

Stefan Krah report at bugs.python.org
Mon Sep 7 17:48:00 CEST 2009


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

Yes, I'll do that.  -  The tracker has eaten my examples, so hopefully
this goes through:

1. format(Decimal("0.12345"), "7.1")   ->  '0.1    '

2. format(Decimal("0.12345"), "7.0g")  ->  '0.1    '

3. format(Decimal("0.12345"), "7.0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.1/decimal.py", line 3611, in __format__
    spec = _parse_format_specifier(specifier, _localeconv=_localeconv)
  File "/usr/lib/python3.1/decimal.py", line 5595, in
_parse_format_specifier
    if format_dict['type'] in 'gG' or format_dict['type'] is None:
TypeError: 'in <string>' requires string as left operand, not NoneType

4. format(float("0.12345"), "7.0")     -> '    0.1'


But I've opened a separate issue now.

----------

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


More information about the Python-bugs-list mailing list