MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / getbytes

Method getbytes

cmd2/utils.py:438–440  ·  view source on GitHub ↗

Get the internal contents as bytes.

(self)

Source from the content-addressed store, hash-verified

436 return self.buffer.byte_buf.decode(encoding=self.encoding, errors=self.errors)
437
438 def getbytes(self) -> bytes:
439 """Get the internal contents as bytes."""
440 return bytes(self.buffer.byte_buf)
441
442 def read(self, size: int | None = -1) -> str:
443 """Read from the internal contents as a str and then clear them out.

Callers 4

readbytesMethod · 0.95
test_stdsim_read_bytesFunction · 0.80

Calls

no outgoing calls

Tested by 3

test_stdsim_read_bytesFunction · 0.64