Antoine Pitrou <pit...@free.fr> added the comment: Since it's a performance improvement, it's Python 3.3-only.
The patch looks ok but there's an unrelated issue. If I first pickle a bytearray under 3.3 using protocol 2: >>> b = bytearray(b'xyz') >>> pickle.dumps(b, protocol=2) b'\x80\x02c__builtin__\nbytearray\nq\x00c__builtin__\nbytes\nq\x01]q\x02(KxKyKze\x85q\x03Rq\x04\x85q\x05Rq\x06.' and then unpickle it under 2.7, I get: >>> pickle.loads(b'\x80\x02c__builtin__\nbytearray\nq\x00c__builtin__\nbytes\nq\x01]q\x02(KxKyKze\x85q\x03Rq\x04\x85q\x05Rq\x06.') bytearray(b'[120, 121, 122]') ... which is wrong. It seems pickling bytes objects with protocol 2 and unpickling them with Python 2.x is broken. ---------- versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13503> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com