On Sat, Feb 13, 2010 at 10:32 PM, Charles R Harris
> Note that ipython calls __repr__ to print the output. __repr__ is supposedIPython calls repr because that's the convention the standard python
> 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
shell uses, and I decided long ago to follow suit.
sympy has pretty remarkable pretty-printing support, perhaps some of
> 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?
that could be reused. Just a thought.
I do agree that 2d printing is tricky, but it doesn't mean it's
useless. For long and complicated expressions, getting the layout
correct is not trivial.
But even good ole' poly1d's display is actually useful for small
polynomials, which can aid if one is debugging a more complex code
with test cases that lead to small polys. I realize this isn't always
viable, but it does happen in practice.
But again, small nits, otherwise happy :) So if you don't see it as
useful or don't have the time/interest, no worries. I don't see it as
important enough to work on it myself, so I'm not going to complain
further either :)
In IPython we're already shipping the 'pretty' extension:
>> out of the box. I don't like using 'training wheels' classes, people
>> tend to learn one thing and use it for a long time, so I think objects
>> should be as fully usable as possible from the get-go. I suspect I
>> wouldn't use/teach a PrettyPoly if it existed.
> I thought the pretty print in the original was intended as a teaching aid,
> but I didn't think it was a good interface for programming work. That said,
> I could add a pretty print option, or a pretty print function. I would be
> happy to provide another method that ipython could look for and call for
> pretty printing if that seems reasonable to you.
So I guess we could just start adding __pretty__ to certain objects
for such fancy representations.