[Numpy-discussion] isn't it a bug in array.fill()?
Stéfan van der Walt
Fri Aug 29 16:00:19 CDT 2008
2008/8/29 Charles R Harris <email@example.com>:
>> I like that idea. A lot of numpy functions return a reference to the
>> modified array when the output array (out) is specified.
> Google up the various discussions of python sort to see why Guido doesn't
> like that sort of thing. We've had that discussion on this list also and
> pretty much decided to follow python in these matters. Not that I really
> agree with Guido here, but it's a small point and when in Rome...
At first, I also thought it might be more intuitive to return the
output array, but then I realised that it would make it more difficult
to realise that the operation is being performed in-place. Maybe it
is good to remind programmers of what happens under the hood, so that
they are not surprised later when their data is "corrupted".
More information about the Numpy-discussion