Thomas Jollans <tho...@jollans.com> added the comment: OK, here's the new patch. I added tests for array(typecode, bytearray(b'abab')), a.extend(b'123') and a.extend(bytearray(b'123')).
@Victor: int itemsize is the array's item size, buffer.itemsize is the strings' (and must be 1) PROBLEM with this patch: I changed "s#" to "y*". This means that str arguments are no longer accepted by fromstring. I don't think they ever should have been in 3.x, but it is an incompatible change and this got the test suite, which (I assume the code hasn't changed since 2.x) used a str argument. (changed in patch). It might be best to use "s*" instead of "y*", especially if this is applied to 3.1? ---------- Added file: http://bugs.python.org/file17749/array2.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8990> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com