[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread SilentGhost
New submission from SilentGhost : According to docs (http://docs.python.org/3.1/reference/datamodel.html#object.__bool__) __bool__ can return 1 or 0 instead of True or False. However, when I ran the following code: Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on win3

[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's not only the docs, the error message is self-contradictory as well. -- assignee: georg.brandl -> nosy: +pitrou priority: -> normal stage: -> needs patch versions: +Python 3.2 ___ Python tracker

[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Probably a misguided merge. Here is a patch that updates the error message, and the documentation. -- keywords: +needs review, patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file14460/bool.patch __

[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread Eric Smith
Eric Smith added the comment: The patch looks good to me. In particular, removing the test for using_len looks correct. The assignment of "result = -1" after PyErr_Format isn't needed, but doesn't hurt (and it was already there, anyway). -- keywords: -needs review nosy: +eric.smith _

[issue6428] TypeError: __bool__ should return bool or int, returned int

2009-07-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: fixed in r73868 (py3k) and r73869 (3.1) Thanks for the report! -- resolution: -> fixed status: open -> closed ___ Python tracker ___