MCPcopy Create free account
hub / github.com/ipython/ipython / buffer_to_bytes

Function buffer_to_bytes

IPython/utils/py3compat.py:36–40  ·  view source on GitHub ↗

Cast a buffer object to bytes

(buf)

Source from the content-addressed store, hash-verified

34 return s
35
36def buffer_to_bytes(buf):
37 """Cast a buffer object to bytes"""
38 if not isinstance(buf, bytes):
39 buf = bytes(buf)
40 return buf
41
42def _modify_str_or_docstring(str_change_func):
43 @functools.wraps(str_change_func)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected