On Sat, Feb 13, 2010 at 11:10 PM, Fernando Perez
On Sat, Feb 13, 2010 at 10:32 PM, Charles R Harris
wrote: Note that ipython calls __repr__ to print the output. __repr__ is supposed to provide a string that can be used to recreate the object, a pretty printed version of __repr__ doesn't provide that. Also, an array or list of
IPython calls repr because that's the convention the standard python shell uses, and I decided long ago to follow suit.
polynomials, having pretty printed entries looks pretty ugly with the newlines and all -- try it with Poly1d. I was also thinking that someone might want to provide a better display at some point, drawing on a canvas, for instance. And what happens when the degree gets up over 100, which is quite reasonable with the Cheybshev polynomials?
sympy has pretty remarkable pretty-printing support, perhaps some of that could be reused. Just a thought.
Curious: how is sympy at deducing recursion relations and/or index functions? Reason: my first thought about Chuck's high-degree issue was that in such cases perhaps PrettyPoly (or __pretty__) could attempt to use summation notation (of course, this would only be useful when the coefficients are formulaic functions of the index, but hey, it's something). DG