[Numpy-discussion] New numpy functions: filled, filled_like
Alan G Isaac
Sun Jan 13 17:54:50 CST 2013
> On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern <email@example.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.
It is not worth a violation to save two keystrokes: "\na".
(Three or four for a longer name, given name completion.)
More information about the NumPy-Discussion