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

Method __array_finalize__

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

Source from the content-addressed store, hash-verified

4682
4683 class BadArr2(np.ndarray):
4684 def __array_finalize__(self, obj):
4685 if isinstance(obj, BadArr2):
4686 # outer inserts 1-sized dims. In that case disturb them.
4687 if self.shape[-1] == 1:
4688 self.shape = self.shape[::-1]
4689
4690 def __array_prepare__(self, obj, context=None):
4691 return obj

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected