[SciPy-dev] Generic polynomials class (was Re: Volunteer for Scipy Project)

Charles R Harris charlesr.harris@gmail....
Tue Oct 13 08:36:26 CDT 2009


On Tue, Oct 13, 2009 at 4:08 AM, Sebastian Walter <
sebastian.walter@gmail.com> wrote:

> IMHO one should adhere to the KISS principle and separate the
> algorithms from the syntactic sugar.
> It also seems to me that hiding the base of the polynomial from the
> user is actually a bad thing.
>
>
It is kiss. You have the separate functions (which is what Robert wanted),
and an interface that is reused. What it buys is complete code reuse in the
interface as well as the ability to limit the operators to classes of the
same sort. Inheritance doesn't really work for this because we don't want to
operate on a common base class (is a relationship). But I think we do want
every class to operate with itself in a similar manner.

As far as I understood, Robert Kern suggested the following a few weeks ago:
> 1) define the algorithms on the coefficients as class methods to avoid
> name cluttering
>

That was my initial thought: static methods. But I don't think that is what
Robert had in mind, I think he just wanted to be sure the basic functions
were available as standalone functions and not just methods of some class.


> 2) have a convenience implementation that uses operator overloading
>
>
The classes do that.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20091013/b529fbac/attachment.html 


More information about the Scipy-dev mailing list