print executes str(), so the only way to make print do that is to override __str__. If you just want it for your own custom classes, you can just override __str__ in those classes. Otherwise, you'll have to hook Basic.__str__, as described at http://docs.sympy.org/0.7.1/modules/printing.html.
Aaron Meurer On Tue, Apr 17, 2012 at 4:19 PM, Alan Bromborsky <abro...@verizon.net> wrote: > I have written my own extensions to LatexPrinting (its parent class is > LatexPrinting) and it works fine, but is there a global way so that > > print A > > will actually execute > > print latex(A) > > so that I have to make fewer changes between terminal and latex printing in > the code. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > 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 sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.