[Python-ideas] Respectively and its unpacking sentence

Steven D'Aprano steve at pearwood.info
Thu Jan 28 06:20:48 EST 2016


On Wed, Jan 27, 2016 at 05:51:46PM -0800, Andrew Barnert wrote:
> On Jan 27, 2016, at 16:12, Steven D'Aprano <steve at pearwood.info> wrote:
> > 
> > I think you would be better off trying to get better support for 
> > vectorized operations into Python:
> 
> I really think, at least 90% of the time, and probably a lot more, 
> people are better off just using numpy than reinventing it. 

Oh I agree.


[...]
> There are a lot more edge cases than you think. For example, you 
> thought far enough ahead that your sum that works column-wise on 2D 
> arrays. But what about when you need to work row-wise?

I thought of all those questions, and honestly I'm not sure what the 
right answer is. But the nice thing about writing code for the simple 
use-cases is that you don't have to worry about the hard use-cases :-)

I'm mostly influenced by the UI of calculators like the HP-48GX and the 
TI CAS calculators, and typically they don't give you the option. If you 
want to do an average across the row, transpose your data :-)


> And after all that, what would be the benefit? I no longer have to 
> install numpy--but now I have to install pyvec instead. Which is just 
> a less-featureful, less-tested, less-optimized, and less-refined 
> numpy.

True, true, and for many people that's probably a deal-breaker. But for 
others, more features == more things you don't understand and don't know 
why you would ever need them.

Anyway, I'm not proposing that any of this should end up in the stdlib, 
so while I could waffle on for hours, I should bring this to a close 
before it goes completely off-topic.




-- 
Steve


More information about the Python-ideas mailing list