[Python-Dev] 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

Skip Montanaro skip@mojam.com (Skip Montanaro)
Thu, 1 Jun 2000 08:48:41 -0500 (CDT)


    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, skip@mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"We have become ... the stewards of life's continuity on earth.  We did not
ask for this role...  We may not be suited to it, but here we are."
- Stephen Jay Gould