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

Method _validate_input

numpy/ma/tests/test_subclassing.py:117–120  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

115 return f'<{self.__class__.__name__} {self}>'
116
117 def _validate_input(self, value):
118 if not isinstance(value, ComplicatedSubArray):
119 raise ValueError("Can only set to MySubArray values")
120 return value
121
122 def __setitem__(self, item, value):
123 # validation ensures direct assignment with ndarray or

Callers 2

__setitem__Method · 0.95
__setitem__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected