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

Charles R Harris charlesr.harris@gmail....
Tue Oct 13 09:49:31 CDT 2009

On Tue, Oct 13, 2009 at 8:14 AM, Pauli Virtanen <pav+sp@iki.fi<pav%2Bsp@iki.fi>
> wrote:

> Tue, 13 Oct 2009 08:00:30 -0600, Charles R Harris wrote:
> [clip]
> > I just don't think inheritance is appropriate here. I'll admit the
> > proposed implementation has a magicky flavor, but in my case that
> > arises because the programming idiom using closures is unfamiliar. In
> > C++ what I would have is a templated class, but python doesn't have
> > such,  while it does have closures.
> [clip]
> If you also change the class names dynamically in the factory, there'll
> be less user confusion.
Well, the class identity is set by where it is instantiated. The isinstance
function will show that Dog and Cat are different classes, i.e., an instance
of Dog will fail in isinstance (mydog, Cat).

> Anyway, you write the code, you call the shots :)
Heh. I am looking for feedback before taking the plunge.

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

More information about the Scipy-dev mailing list