Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6453] Improve bool TypeError message

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 9, 2009, 2:21 PM

Post #1 of 8 (342 views)
Permalink
[issue6453] Improve bool TypeError message

New submission from Terry J. Reedy <tjreedy [at] udel>:

>>> cc=c()
>>> bool(cc)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
bool(cc)
TypeError: __bool__ should return bool or int, returned int

This is slightly jarring.
Adding ' 0 or 1' after 'or int' would be nice (and trivial).
Adding str(val) at the end after type(val) would be even nicer.

----------
components: Interpreter Core
keywords: easy
messages: 90355
nosy: tjreedy
severity: normal
status: open
title: Improve bool TypeError message
type: feature request
versions: Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 2:40 PM

Post #2 of 8 (322 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

The error message is in error. Int is not allowed in 3.x, only bool.
This is thus superseded by issue 6428, which has already been fixed.

----------
nosy: +r.david.murray
priority: -> normal
resolution: -> duplicate
stage: -> committed/rejected
status: open -> closed
superseder: -> TypeError: __bool__ should return bool or int, returned int

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 8:37 PM

Post #3 of 8 (321 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

Terry J. Reedy <tjreedy [at] udel> added the comment:

Phooey. I searched for 'bool TypeError' but it failed to return 6428.
I will ask on py-dev why not.

----------
priority: normal ->
resolution: duplicate ->
stage: committed/rejected ->
status: closed -> open

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2009, 1:53 AM

Post #4 of 8 (319 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

Changes by Amaury Forgeot d'Arc <amauryfa [at] gmail>:


----------
resolution: -> duplicate
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2009, 2:33 PM

Post #5 of 8 (314 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

Terry J. Reedy <tjreedy [at] udel> added the comment:

Testing.
I am 99.9% sure *I* did not reopen. Testing to see if OP post auto-reopens.

----------
nosy: -r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2009, 2:36 PM

Post #6 of 8 (312 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

Terry J. Reedy <tjreedy [at] udel> added the comment:

Must have been random glitch. I certainly did not change state and priority.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2009, 7:27 PM

Post #7 of 8 (303 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

On your test post I got deleted from the nosy list. Was that intentional?

I wonder if your browser is doing something weird with the form field
settings. Or it may have as you say been a random thing...I know that
has happened to me once or twice where I refreshed the page in an odd
order and reset some fields I wasn't intending to reset.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2009, 9:58 PM

Post #8 of 8 (300 views)
Permalink
[issue6453] Improve bool TypeError message [In reply to]

Terry J. Reedy <tjreedy [at] udel> added the comment:

yes, I was trying to avoid bothering you with the noise.
This is one of those 'everything gone wrong' situations.
If only I had unselected 'open only' when I did the search...

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6453>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.