MCPcopy Index your code
hub / github.com/python/cpython / MemviewBytesIO

Class MemviewBytesIO

Lib/test/test_io/test_textio.py:1429–1437  ·  view source on GitHub ↗

A BytesIO object whose read method returns memoryviews rather than bytes

Source from the content-addressed store, hash-verified

1427
1428
1429class MemviewBytesIO(io.BytesIO):
1430 '''A BytesIO object whose read method returns memoryviews
1431 rather than bytes'''
1432
1433 def read1(self, len_):
1434 return _to_memoryview(super().read1(len_))
1435
1436 def read(self, len_):
1437 return _to_memoryview(super().read(len_))
1438
1439def _to_memoryview(buf):
1440 '''Convert bytes-object *buf* to a non-trivial memoryview'''

Callers 1

test_read_byteslikeMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_read_byteslikeMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…