MCPcopy Create free account
hub / github.com/numpy/numpy / asbytes

Function asbytes

numpy/_utils/_convertions.py:15–18  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

13
14
15def asbytes(s):
16 if isinstance(s, bytes):
17 return s
18 return str(s).encode('latin1')

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected