On Wednesday, September 30, 2015 at 4:01:17 PM UTC-4, Christoph Ortner 
wrote:
>
> I simply dislike is that linspace does not behave as expected, and I 
> expect that this is the main reason for other as well. To give an extreme 
> analogy, we don't go around and start defining A * B = A + B either, and 
> linspace and similar names are just so ingrained in the Matlab (and 
> apparently also Python) community, that it trips us up when they suddenly 
> behave differently.
>

This is a bad analogy.  linspace still returns an AbstractVector with the 
same elements.   So, it's basically doing the same thing as before, and is 
just implemented differently.

The question is, why does this implementation detail of linspace matter to 
you?  It still behaves the same way in nearly every context.  The cases 
where it behaves differently are probably mostly bugs (overly restrictive 
types of function parameters) that were waiting to be caught.
 

>
> Finally, I don't buy the argument that linspace should be abstracted 
> because of memory. It always creates one-dimensional grids, and those 
> aren't the issue. There is a much stronger argument to create an 
> abstraction for meshgrid and I even disliked that that one was dropped.
>

We don't need an abstraction for meshgrid, since in pretty much all 
applications of meshgrid you can use broadcasting operations instead (far 
more efficiently).

I used to want meshgrid too, but it was only because I wasn't used to 
broadcasting operations. Since then, I have never found a case in which 
meshgrid would have been easier than the broadcasting operations.

Reply via email to