I am having a weird subclass numpy.ndarray issue that feels like
Values of instance variables of superclass persist across instances of subclass
But I have not been
The problem is here:
def __new__(cls, input_array, attrs={})
Never do this attrs={}
in a function header. The expected result is (probably) not what you think it is. This is a common Python Pitfall. See here Default Parameter Values in Python
The right way how to do this:
def __new__(cls, input_array, attrs=None):
if attrs is None:
attrs = {}