This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / _core / _internal / _getfield_is_safe

function

numpy._core._internal:_getfield_is_safe

source: build-install/usr/lib/python3.14/site-packages/numpy/_core/_internal.py :467

Signature

def   _getfield_is_safe ( oldtype newtype offset )

Summary

Checks safety of getfield for object arrays.

Extended Summary

As in _view_is_safe, we need to check that memory containing objects is not reinterpreted as a non-object datatype and vice versa.

Parameters

oldtype : data-type

Data type of the original ndarray.

newtype : data-type

Data type of the field being accessed by ndarray.getfield

offset : int

Offset of the field being accessed by ndarray.getfield

Raises

: TypeError

If the field access is invalid

Aliases

  • numpy._core._internal._getfield_is_safe