# HG changeset patch # User Paul Boddie # Date 1479910649 -3600 # Node ID a7684997ef7a11555eac21949444ccb80b141a61 # Parent b155f3ec4b378af94cea5ca4d0cab18f3f298370 Treat buffer initialisation arguments as append inputs. Test mixing of object types in list serialisation. diff -r b155f3ec4b37 -r a7684997ef7a lib/__builtins__/buffer.py --- a/lib/__builtins__/buffer.py Wed Nov 23 14:27:21 2016 +0100 +++ b/lib/__builtins__/buffer.py Wed Nov 23 15:17:29 2016 +0100 @@ -38,15 +38,18 @@ self.__data__ = _list_init(n) - # Append all arguments in string form to the buffer. + # Append all arguments to the buffer. if args: for arg in args: - _list_append(self, str(arg)) + self.append(arg) def append(self, s): - "Append 's' to the buffer." + """ + Append 's' to the buffer, concatenating buffers and adding other objects + in string form. + """ if isinstance(s, buffer): _list_concat(self, s) diff -r b155f3ec4b37 -r a7684997ef7a tests/list.py --- a/tests/list.py Wed Nov 23 14:27:21 2016 +0100 +++ b/tests/list.py Wed Nov 23 15:17:29 2016 +0100 @@ -1,5 +1,5 @@ l = [1, 2, 3] -l.append(4) +l.append("four") print len(l) print l[0] print l[1]