Index: Lib/test/test_bool.py =================================================================== --- Lib/test/test_bool.py (revision 79474) +++ Lib/test/test_bool.py (working copy) @@ -44,6 +44,19 @@ self.assertIsNot(int(False), False) self.assertEqual(int(True), 1) self.assertIsNot(int(True), True) + + def test_float(self): + self.assertEqual(float(False), 0.0) + self.assertIsNot(float(False), False) + self.assertEqual(float(True), 1.0) + self.assertIsNot(float(True), True) + + def test_decimal(self): + from decimal import Decimal + self.assertIs(bool(Decimal(0)), False) + self.assertIs(bool(Decimal(1)), True) + self.assertEqual(Decimal(True), Decimal(1)) + self.assertEqual(Decimal(False), Decimal(0)) def test_math(self): self.assertEqual(+False, 0) @@ -234,6 +247,11 @@ self.assertIs(f.closed, True) finally: os.remove(support.TESTFN) + def test_types(self): + # types are always true. + for t in [bool, complex, dict, float, int, list, object, + set, str, tuple, type]: + self.assertIs(bool(t), True) def test_operator(self): import operator