Message248089
In my experience, I tend to only use memoryview() for “bytes-like” buffers (but see Issue 23756 about clarifying what this means). Example from /Lib/_compression.py:67:
def readinto(self, b):
with memoryview(b) as view, view.cast("B") as byte_view:
data = self.read(len(byte_view))
byte_view[:len(data)] = data
return len(data)
Fixing cast("B") or adding a memoryview(raw=True) mode could probably help when all you want is a byte buffer. |
|
Date |
User |
Action |
Args |
2015-08-06 00:44:05 | martin.panter | set | recipients:
+ martin.panter, pitrou, skrah, dabeaz, cblp, josh.r |
2015-08-06 00:44:05 | martin.panter | set | messageid: <1438821845.38.0.0232146751723.issue15944@psf.upfronthosting.co.za> |
2015-08-06 00:44:05 | martin.panter | link | issue15944 messages |
2015-08-06 00:44:04 | martin.panter | create | |
|