MCPcopy
hub / github.com/numpy/numpy / inspect

Method inspect

numpy/lib/tests/test_recfunctions.py:329–333  ·  view source on GitHub ↗
(dt, dtype=None)

Source from the content-addressed store, hash-verified

327 return np.dtype([(f'x{i}', dt) for i, dt in enumerate(dts)])
328
329 def inspect(dt, dtype=None):
330 arr = np.zeros((), dt)
331 ret = structured_to_unstructured(arr, dtype=dtype)
332 backarr = unstructured_to_structured(ret, dt)
333 return ret.shape, ret.dtype, backarr.dtype
334
335 dt = structured(subarray(structured(np.int32, np.int32), 3))
336 assert_equal(inspect(dt), ((6,), np.int32, dt))

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected