[issue7811] [decimal] ValueError -> TypeError in from_tuple

Stefan Krah report at bugs.python.org
Sat Jan 30 15:16:18 CET 2010


New submission from Stefan Krah <stefan-usenet at bytereef.org>:

As discussed privately, the following test cases should raise TypeError
(currently ValueError):

self.assertRaises(TypeError, Decimal, (0., (4, 3, 4, 9, 1), 2) )
self.assertRaises(TypeError, Decimal, (Decimal(1), (4, 3, 4, 9, 1), 2))
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, 9, 1), 0.) )
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, None, 1), 2) )
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )

----------
messages: 98564
nosy: mark.dickinson, skrah
severity: normal
status: open
title: [decimal] ValueError -> TypeError in from_tuple

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


More information about the Python-bugs-list mailing list