[Numpy-discussion] Ticket #798: `piecewise` exposes raw memory

Ondrej Certik ondrej at certik.cz
Wed May 21 05:53:15 EDT 2008


On Wed, May 21, 2008 at 11:30 AM, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> Referring to
> http://scipy.org/scipy/numpy/ticket/798
>
> `piecewise` uses `empty` to allocate output memory.  If the conditions
> do not sufficiently cover the output, then raw memory is returned,
> e.g.,
>
> {{{
> import numpy as np
> np.piecewise([0,1,2],[True,False,False],[1])
> }}}
>
> A patch which addresses the issue is available here for review:
>
> http://codereview.appspot.com/1105
>
> Documentation is being updated on the wiki.

I'd like to invite everyone to take part in the review. It's fun, it's
just talking, no coding. :)

Ondrej


More information about the NumPy-Discussion mailing list