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

Function _is_bytes_like

numpy/lib/_iotools.py:48–56  ·  view source on GitHub ↗

Check whether obj behaves like a bytes object.

(obj)

Source from the content-addressed store, hash-verified

46
47
48def _is_bytes_like(obj):
49 """
50 Check whether obj behaves like a bytes object.
51 """
52 try:
53 obj + b''
54 except (TypeError, ValueError):
55 return False
56 return True
57
58
59def has_nested_fields(ndtype):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected