[Numpy-discussion] New numpy functions: filled, filled_like

Alan G Isaac alan.isaac@gmail....
Sun Jan 13 17:54:50 CST 2013

> On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern <robert.kern@gmail.com> wrote:
>> One alternative that does not expand the API with two-liners is to let
>> the ndarray.fill() method return self:
>>    a = np.empty(...).fill(20.0)

On 1/13/2013 6:39 PM, Nathaniel Smith wrote:
> This violates the convention that in-place operations never return
> self, to avoid confusion with out-of-place operations.

Strongly agree.
It is not worth a violation to save two keystrokes: "\na".
(Three or four for a longer name, given name completion.)

Alan Isaac

More information about the NumPy-Discussion mailing list