Message 171008 - Python tracker (original) (raw)

I think you should keep the Py_buffers alive in an array, and only release them at the end (it may also be slightly faster to do so).

However allocation of this array may considerably slow down the function. We may need the special-case for bytes and bytearray. Stop, and the bytearray (or bytearray subclass) can change size between two calls to Py_SIZE()?