This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: improve object.c and abstract.c exception messages
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: arigo, georg.brandl
Priority: normal Keywords: patch

Created on 2006-06-17 08:38 by georg.brandl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
error-msgs.diff georg.brandl, 2006-06-17 11:20 v2
Messages (5)
msg50495 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-17 08:38
This patch adds the type of the offending object to
many error messages in the abstract APIs, such as
"iteration over non-sequence".
msg50496 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2006-06-17 10:55
Logged In: YES 
user_id=4771

One message is wrong, in typeobject.c:slot_tp_hash().
The object that is unhashable is not 'func', it is 'self'.

In abstract.c, maybe the two error messages from
PySequence_Size() and PyMapping_Size() should be different,
as they depend on the presence of a different slot.  I'd
suggest, respectively, "len() of non-sequence object
'%.200s'" and "len() of non-mapping object '%.200s'".

The rest looks good and quite useful IMHO :-)
msg50497 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-17 11:20
Logged In: YES 
user_id=849994

Thanks for your review! I incorporated the changes into the
2nd version.
msg50498 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2006-06-18 20:23
Logged In: YES 
user_id=4771

Looks good.  I think this should be checked in the trunk ASAP.
msg50499 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-18 22:17
Logged In: YES 
user_id=849994

Committed in revision 47017.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43517
2006-06-17 08:38:22georg.brandlcreate