This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients nikratio, pitrou, serhiy.storchaka, vstinner
Date 2014-03-26.10:43:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> class MyByteStream(BytesIO):
>    def read1(self, len_):
>        return memoryview(super().read(len_))
> bs = MyByteStream(b'some data in ascii\n')

I guess that you are trying to implement a zero-copy I/O. The problem is that BytesIO does copy data. Example:

>>> data=b'abcdef'
>>> x=io.BytesIO(data)
>>> is  data

Before trying to avoid copies in the "buffered" layer, something should be done for the "raw" layer (BytesIO in this case).
Date User Action Args
2014-03-26 10:43:15vstinnersetrecipients: + vstinner, pitrou, nikratio, serhiy.storchaka
2014-03-26 10:43:14vstinnersetmessageid: <>
2014-03-26 10:43:14vstinnerlinkissue21057 messages
2014-03-26 10:43:14vstinnercreate