[Numpy-discussion] Ransom Proposals

Bill Baxter wbaxter at gmail.com
Sun Mar 26 18:15:03 CST 2006


On 3/26/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>
> > Or, you can use the reshape method instead of function.  I believe
> > numpy advocates use of methods instead of functions.  What you observe
> > is just another reason for that.  Since functions like reshape remain
> > in numpy primarily for backwards compatibility, I would be against any
> > change in semantics.
>
> Mmh.  I bet many people will continue to use the functional interface for
> a
> long time.



And maybe they'd be right to want a functional interface, too:
http://www.gotw.ca/gotw/084.htm


The author argues that in general, you should make as few functions as
possible be members of a class, always preferring non-member functions
wherever possible.   It's about C++, but the principle should apply to
Python as well.  It does make a certain kind of sense, although the article
seems to completely ignore polymorphism, which seems like it would be
another good reason to have functions be members, at least in C++.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060326/50916bd4/attachment.html 


More information about the Numpy-discussion mailing list