[issue37427] sorted() and list.sort() don't accept non-boolean objects with __bool__() as `reverse` parameter

2019-06-27 Thread NODA, Kai
New submission from NODA, Kai : class X: def __bool__(self): return True x = [1, 2, 3] x.sort(reverse=X()) print(x) print(sorted([1, 2, 3], reverse=X())) TypeError: an integer is required (got type X) We can always still do x.sort(reverse=bool(X())) print(sorted([1, 2, 3

[issue32971] unittest.TestCase.assertRaises

2018-02-28 Thread NODA, Kai
New submission from NODA, Kai : https://docs.python.org/dev/library/unittest.html#unittest.TestCase.assertRaises > If only the exception and possibly the msg arguments are given, return a > context manager so that the code under test can be written inline rather than > as a

[issue32971] Docs on unittest.TestCase.assertRaises() should be improved

2018-02-28 Thread NODA, Kai
Change by NODA, Kai : -- title: unittest.TestCase.assertRaises -> Docs on unittest.TestCase.assertRaises() should be improved ___ Python tracker <https://bugs.python.org/issu