Message248089
| Author |
martin.panter |
| Recipients |
cblp, dabeaz, josh.r, martin.panter, pitrou, skrah |
| Date |
2015年08月06日.00:44:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1438821845.38.0.0232146751723.issue15944@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|