[Numpy-discussion] ndarray methods vs numpy module functions

David Cournapeau david@ar.media.kyoto-u.ac...
Tue Jun 24 03:23:24 CDT 2008


Sebastian Haase wrote:
> Are you saying the duplication is "just random" ?  It would be better
> -- as in: principle of minimum surprise -- if there would be some sort
> "reasonable set" of duplicates ....

Yes it would be better. But how do you do it without breaking other
people code and avoiding duplication ? That's a trade-off: if we remove
say numpy.sum, people will complain that numpy.sum does not exist.
Adding all the functions in numpy arrays to be able to say a.foo instead
of foo(a) is not that great either. I think we can spend our time on
more interesting/important problems.

> If there are only a handful functions missing, why not try to make it complete.
Duplication is bad, and should be avoided as much as possible. a.foo vs
foo(a) does not sound like a good case to introduce more duplication ot me.

cheers,

David


More information about the Numpy-discussion mailing list