You mean the print statement? That works by calling str() on the arguments. So you'll want to override __str__, or extend the StrPrinter.
In Python 3, of course, you can just override the print() function. Aaron Meurer On Fri, Feb 24, 2012 at 11:05 AM, Alan Bromborsky <[email protected]> wrote: > On 02/24/2012 12:18 PM, Alan Bromborsky wrote: >> >> On 02/24/2012 11:31 AM, Alan Bromborsky wrote: >>> >>> What would be the best way of modifying the printing behavior of >>> functions and derivatives without modifying the core? >>> >> I found the tutorial on modifying printers. No reply needed. >> > I spoke too soon. To use new printer model interactively > > sys.displayhook = GAprint > > works. But how do you get print to use GAprint in a script > (noninteractivley)? > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
