[Numpy-discussion] __array_wrap__

Charles R Harris charlesr.harris@gmail....
Tue Sep 29 14:07:49 CDT 2009

On Tue, Sep 29, 2009 at 12:55 PM, Neal Becker <ndbecker2@gmail.com> wrote:

> This seems to work now, but I'm wondering if Charles is correct, that
> inheritance isn't such a great idea here.
> The advantage of inheritance is I don't have to implement forwarding all
> the
> functions, a pretty big advantage. (I wonder if there is some way to do
> some
> of these as a generic 'mixin'?)
Using inheritance for implementation is not the thing to do. The usual bit
of wisdom is to ask the questions "is a?" and "is implemented with?". If the
answer to the first question is no, then don't use inheritance. Sometimes
private inheritance is used in C++, but even that isn't considered best

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090929/f6c58e38/attachment.html 

More information about the NumPy-Discussion mailing list