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

Method __str__

numpy/exceptions.py:176–186  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

174 self.ndim = ndim
175
176 def __str__(self):
177 axis = self.axis
178 ndim = self.ndim
179
180 if axis is ndim is None:
181 return self._msg
182 else:
183 msg = f"axis {axis} is out of bounds for array of dimension {ndim}"
184 if self._msg is not None:
185 msg = f"{self._msg}: {msg}"
186 return msg
187
188
189class DTypePromotionError(TypeError):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected