My argument is that `where` makes sense unless `out` is default `None`, in 
which case it simply obscures the creation of a partially uninitialised array.

The casual numpy user accessing through the public API likely only wants 
garbage values if they have explicitly asked for them using `empty_like`. If 
they have decided not to pass `out`, it probably means they expect a partially 
transformed copy of the input array and have overlooked the note in the 
docstring.

Example:

User creates a function that log transforms values where log is defined .

```
def safe_log(val, out):
    return np.log(val, where=np.greater(val, 0), out=out)
```

User suddenly decides that they don't want to specify `out` every time, making 
`safe_log` unsafe.

```
def safe_log(val, out=None):
    return np.log(val, where=np.greater(val, 0), out=out)
```
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to