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
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
Change by NODA, Kai :
--
title: unittest.TestCase.assertRaises -> Docs on
unittest.TestCase.assertRaises() should be improved
___
Python tracker
<https://bugs.python.org/issu