This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients christian.heimes, ezio.melotti, mark.dickinson, skrah
Date 2013-02-19.22:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20130219225002.GA32532@sleipnir.bytereef.org>
In-reply-to <1361313396.75.0.00349079358128.issue17247@psf.upfronthosting.co.za>
Content
Christian Heimes <report@bugs.python.org> wrote:
> The output is from Python 3.3. Why has Python 3.3 a less informative error message than 3.2?

Because the error is discovered in libmpdec and it would require a significant
amount of work to provide fine-grained error messages.

> I also wonder why it works with floats if it has a special meaning?
> Either float or Decimal is broken.

Yes, IMO float should detect the ambiguity. You see that the zero implies left
padding:

>>> "{:06}".format(1.2)
'0001.2'

And in case of a conflict right padding wins:

>>> "{:<06}".format(1.2)
'1.2000'

The unambiguous way to get right padding is:

>>> "{:0<6}".format(Decimal("1.2"))
'1.2000'

>>> "{:X<6}".format(Decimal("1.2"))
'1.2XXX'
History
Date User Action Args
2013-02-19 22:50:00skrahsetrecipients: + skrah, mark.dickinson, christian.heimes, ezio.melotti
2013-02-19 22:50:00skrahlinkissue17247 messages
2013-02-19 22:50:00skrahcreate