[Numpy-discussion] not inheriting from ndarray

Neal Becker ndbecker2 at gmail.com
Tue Jul 14 07:19:21 EDT 2015

I wanted the function of an array that accumulates my results, it starts at 
zero size, and resizes as needed.  New results are added using

accumulated += new_array

A simple implementation of this is here:


I have 2 questions:

1. Is this a reasonable approach?

2. I overloaded += to do 1) resize 2) call ndarray += operator
Is there some way to just overload all arithmetic operators similarly all at 
the same time?  (I don't need them for the current work, I'm just curious).

More information about the NumPy-Discussion mailing list