Re: [Python-checkins] CVS: python/dist/src/Objects listobject.c,2.69,2.70 stringobject.c,2.65,2.66 tupleobject.c,2.33,2.34

Fred> Log Message: Fred> Michael Hudson mwh21@cam.ac.uk: Fred> Removed PyErr_BadArgument() calls and replaced them with more Fred> useful error messages.
... Fred> --- 389,395 ---- Fred> PyListObject *np; Fred> if (!PyList_Check(bb)) { Fred> ! PyErr_Format(PyExc_TypeError, Fred> ! "can only append list (not "%.200s") to list", Fred> ! bb->ob_type->tp_name); Fred> return NULL; Fred> } Fred> *************** ...
I've seen this new error message cross my mailbox a few times. On the face of it, it's incorrect, because you can append any sort of object to a list, right? This message appears in the list_concat method. Shouldn't it be something like
can't concatenate "%.200s" object with list
? I would consider this change very picky except for the fact that it's making a statement about the properties of lists that is clearly not true.

Skip Montanaro writes:
I've seen this new error message cross my mailbox a few times. On the face of it, it's incorrect, because you can append any sort of object to a list, right? This message appears in the list_concat method. Shouldn't it be something like
can't concatenate \"%.200s\" object with list
Skip, You're right! How about:
can only concatenate list (not "%.200s") to list
If you don't object by the time this mail reaches you, I'll check it in. ;)
-Fred

On Thu, 1 Jun 2000, Fred L. Drake, Jr. wrote:
Skip Montanaro writes:
I've seen this new error message cross my mailbox a few times. On the face of it, it's incorrect, because you can append any sort of object to a list, right? This message appears in the list_concat method. Shouldn't it be something like
can't concatenate \"%.200s\" object with list
Skip, You're right! How about:
can only concatenate list (not \"%.200s\") to list
If you don't object by the time this mail reaches you, I'll check it in. ;)
Then you'd better do something about tupleobject.c as well; I'd also say
can only concatenate list (not "%.200s") and list can only concatenate tuple (not "%.200s") and tuple
are slightly preferable, on reflection (note the s/to/and/).
Cheers, Michael
participants (3)
-
Fred L. Drake, Jr.
-
Michael Hudson
-
Skip Montanaro