MCPcopy Index your code
hub / github.com/RustPython/RustPython / readbuffer_encode

Function readbuffer_encode

Lib/_pycodecs.py:106–112  ·  view source on GitHub ↗

None

(obj, errors="strict")

Source from the content-addressed store, hash-verified

104
105
106def readbuffer_encode(obj, errors="strict"):
107 """None"""
108 if isinstance(obj, str):
109 res = obj.encode()
110 else:
111 res = bytes(obj)
112 return res, len(obj)
113
114
115def escape_encode(obj, errors="strict"):

Callers

nothing calls this directly

Calls 3

isinstanceFunction · 0.85
lenFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected