Message 129522 - Python tracker (original) (raw)
Attaching a patch adding copy() and clear() to bytearrays, with tests and doc.
I didn't add the methods to MutableSequence because I have a doubt about it - in particular which exception get raised by .pop if it's empty. Curiously, lists and bytearrays raise different exceptions in this case - IndexError and OverflowError, respectively.