Index: Objects/typeobject.c =================================================================== --- Objects/typeobject.c (revision 73867) +++ Objects/typeobject.c (working copy) @@ -4807,10 +4807,8 @@ } else { PyErr_Format(PyExc_TypeError, - "%s should return " - "bool or int, returned %s", - (using_len ? "__len__" - : "__bool__"), + "__bool__ should return " + "bool, returned %s", Py_TYPE(temp)->tp_name); result = -1; } Index: Doc/reference/datamodel.rst =================================================================== --- Doc/reference/datamodel.rst (revision 73867) +++ Doc/reference/datamodel.rst (working copy) @@ -1254,11 +1254,11 @@ .. index:: single: __len__() (mapping object method) Called to implement truth value testing and the built-in operation - ``bool()``; should return ``False`` or ``True``, or their integer equivalents - ``0`` or ``1``. When this method is not defined, :meth:`__len__` is called, - if it is defined, and the object is considered true if its result is nonzero. - If a class defines neither :meth:`__len__` nor :meth:`__bool__`, all its - instances are considered true. + ``bool()``; should return ``False`` or ``True``. When this method is not + defined, :meth:`__len__` is called, if it is defined, and the object is + considered true if its result is nonzero. If a class defines neither + :meth:`__len__` nor :meth:`__bool__`, all its instances are considered + true. .. _attribute-access: