[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

Serhiy Storchaka report at bugs.python.org
Tue Mar 17 23:16:10 CET 2015


Serhiy Storchaka added the comment:

> With and without the patch, write() accepts bytes, bytearray and memoryview.
> Which other byte-like types do you know?

The "bytes-like object" term is used as an alias of "an instance of type that 
supports buffer protocol". Besides bytes, bytearray and memoryview, this is 
array.array and NumPy arrays. file.write() supports arbitrary bytes-like 
objects, including array.array and NumPy arrays.

> writeframesraw() method of aifc, sunau and wave modules use this pattern:

Yes, I wrote this code, if I remember correct.

----------
title: unnecessary copying of memoryview in gzip.GzipFile.write ? -> unnecessary copying of memoryview in gzip.GzipFile.write?

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23688>
_______________________________________


More information about the Python-bugs-list mailing list