[Numpy-discussion] Deprecate poly1d and replace with Poly1d ?

Charles R Harris charlesr.harris@gmail....
Mon Sep 28 15:46:32 CDT 2009


Because poly1d exports the __array__ interface, a design error IMHO that
makes it play badly with the prospective chebyshev module. For example the
following should convert from a Chebyshev series to a power series

chebval([1,0,0], poly1d(1,0))

and it does if I make sure to pass the poly1d as object in an array, but to
do that I have to check that it is an instance of poly1d and take special
measures. I shouldn't have to do that, it violates duck typing.

The more basic problem here is making poly1d look like an array, which it
isn't. The array bit is an implementation detail and would be private in
C++. with an as_array method to retrieve the details if wanted.

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


More information about the NumPy-Discussion mailing list