[Python-Dev] Q: is concatenation and append really the same thing?

Michael Hudson mwh21@cam.ac.uk
16 Jun 2000 17:53:42 +0100


"Fredrik Lundh" <effbot@telia.com> writes:

> Python 1.6a2 (#0, Jun 14 2000, 23:07:49) [MSC 32 bit (Intel)] on win32
> >>> (1, 2, 3) + [1, 2, 3]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: can only append tuple (not "list") to tuple
> 
> is "append" really the right word here?

My fault.  I have sent at least one patch to patches@python.org to
change it to

can only concatenate tuple (not "list") to tuple

to bring it into line with listobject.c; here it is again:

Index: Objects/tupleobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v
retrieving revision 2.34
diff -u -r2.34 tupleobject.c
--- Objects/tupleobject.c	2000/06/01 03:12:13	2.34
+++ Objects/tupleobject.c	2000/06/06 16:30:39
@@ -362,7 +362,7 @@
 	PyTupleObject *np;
 	if (!PyTuple_Check(bb)) {
 		PyErr_Format(PyExc_TypeError,
-       		     "can only append tuple (not \"%.200s\") to tuple",
+       		     "can only concatenate tuple (not \"%.200s\") to tuple",
 			     bb->ob_type->tp_name);
 		return NULL;
 	}

HTH, HAND,
Michael