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

Method __array_finalize__

numpy/core/tests/test_umath.py:4675–4678  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

4673def test_outer_bad_subclass():
4674 class BadArr1(np.ndarray):
4675 def __array_finalize__(self, obj):
4676 # The outer call reshapes to 3 dims, try to do a bad reshape.
4677 if self.ndim == 3:
4678 self.shape = self.shape + (1,)
4679
4680 def __array_prepare__(self, obj, context=None):
4681 return obj

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected