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

Function _check_nonneg_int

numpy/lib/npyio.py:787–793  ·  view source on GitHub ↗
(value, name="argument")

Source from the content-addressed store, hash-verified

785
786
787def _check_nonneg_int(value, name="argument"):
788 try:
789 operator.index(value)
790 except TypeError:
791 raise TypeError(f"{name} must be an integer") from None
792 if value < 0:
793 raise ValueError(f"{name} must be nonnegative")
794
795
796def _preprocess_comments(iterable, comments, encoding):

Callers 1

_readFunction · 0.85

Calls 1

indexMethod · 0.45

Tested by

no test coverage detected