[Numpy-discussion] setmember1d memory leak?

Robert Kern robert.kern at gmail.com
Fri Jan 26 13:27:32 EST 2007

Charles R Harris wrote:

> This would be easy to add. I could put in an option side='mask' that
> would return 1 if the object is found, 0 otherwise. The type would be
> integer rather than boolean but I don't see that as a big problem. If I
> add that, I would like to change the keyword to mode instead of side and
> that brings up the question of how to change the interface. It is easy
> to use the same meaning for both mode and side for a while, but it would
> be nice to issue a deprecation warning for the latter and then remove it
> after some fixed period of time. This is a policy question and I think
> the numpy team needs a policy for such things.

If the semantics of the returned value is going to change so greatly, I would
prefer that they be separate functions. I think integer 1s and 0s instead of
booleans *is* a large problem. Such an array can't be used correctly as a mask
in fancy indexing. Inevitably someone will try and wonder why they get an array
with only the first and second elements of the source array.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list